I met an issue about Behavior Designer Editor.
I was trying to cast an Enum to SharedVariable, like
public enum SomeEnum : uint{}
public class SharedSomeEnum : SharedVariable<SomeEnum>{}
And Then added a Conditiaonal to compare two SomeEnum, like
public class CompareSomeEnumValue : Conditional
{
public SharedSomeEnum someEnum1;
public SharedSomeEnum someEnum2;
.....
}
Then, when I drag the CompareSomeEnumValue conditional to the editor, an error was reported:
InvalidCastException: Specified cast is not valid.
BehaviorDesigner.Editor.BinarySerialization.SaveField (System.Type fieldType, System.String fieldName, System.Int32 hashPrefix, System.Object value, System.Reflection.FieldInfo fieldInfo) (at <c907413e7b974c73aba6a97e2cd24327>:0)
......
Seems problem happens in Editor's BinarySerialization.cs, at line:
else if (filedType.Equals(typeof (int)) || fieldType.IsEnum)
Could you help to fix? Make the enum support uint, and byte...
I was trying to cast an Enum to SharedVariable, like
public enum SomeEnum : uint{}
public class SharedSomeEnum : SharedVariable<SomeEnum>{}
And Then added a Conditiaonal to compare two SomeEnum, like
public class CompareSomeEnumValue : Conditional
{
public SharedSomeEnum someEnum1;
public SharedSomeEnum someEnum2;
.....
}
Then, when I drag the CompareSomeEnumValue conditional to the editor, an error was reported:
InvalidCastException: Specified cast is not valid.
BehaviorDesigner.Editor.BinarySerialization.SaveField (System.Type fieldType, System.String fieldName, System.Int32 hashPrefix, System.Object value, System.Reflection.FieldInfo fieldInfo) (at <c907413e7b974c73aba6a97e2cd24327>:0)
......
Seems problem happens in Editor's BinarySerialization.cs, at line:
else if (filedType.Equals(typeof (int)) || fieldType.IsEnum)
Could you help to fix? Make the enum support uint, and byte...