[Bug] Enum field in Conditional was restored to default value(=0) after building the C# code of the Coditional

Ray

New member
Reproduce Step:

1. Write a C# code for a custom Conditional, who has a enum field.


C#:
public enum MyEnum {
    Enum0,
    Enum1,
    Enum2
}

public class CustomConditional : Conditional
{
    public MyEnum myEnum;
}

2. In Behavior Designer Editor, drag CustomConditional into the panel. Then set My Enum field value to Enum2.

1573027335083.png

3. Modify CustomConditional C# code, add a space at last line ( to let unity build the code )

4. My Enum field was restored to default value.
1573027494887.png


Expection:

My Enum stays in Enum 2.

Or I have to search all the Custom Conditionals in all Behavior Trees, and set them back to Enum 2 one by one, by hand...
 
Last edited:
I just tried to reproduce it but wasn't able to. When I pasted the script I got a compiler error because "public MyEnum" didn't define the enum:

Code:
public enum MyEnum
...
 
Sorry for the type missing. I modified the post above, added keyword "enum" in front of MyEnum. There shouldn't be any compiler error anymore
 
Have you tried it in a fresh project? I am using the version of Behavior Designer that I sent you in Unity 2019.2 and am not able to reproduce it. As a test you can also switch to JSON serialization (under preferences on the top right of the BD editor)
 
Ah, I think I found the reason. This issue happens when I use BehaviorDesigner.Runtime.dll that you send me via email.

Here's the test I did (All in a Fresh project, using Unity2019.2) :

1. Original BehaviorDesigner from App Store ==> OK
2. Original BehaviorDesigner.Runtime.dll + BehaviorDesigner.Editor.dll via email ==> OK
3. BehaviorDesigner.Runtime.dll via email + BehaviorDesigner.Editor.dll via email ==> Not OK

So, I just need to use 2.Original BehaviorDesigner.Runtime.dll + BehaviorDesigner.Editor.dll via email, and problem resolved.
 
Hmm.. when I tested it I used the same dlls that I sent you via email. Can you try it in a fresh project just to see if the bug still occurs with the emailed dlls?
 
Yeah, I tried it again in a fresh project with the emailed dlls, and the issue still happend.
I recorded a video, and send it via email. Please have a check, hope that helpful.
 
Top