hecomi / uREPL

In-game powerful REPL environment for Unity3D.
http://tips.hecomi.com/entry/2015/12/05/003000
MIT License
551 stars 54 forks source link

EnumFieldItem has ArgumentException #12

Closed kairipton closed 5 years ago

kairipton commented 6 years ago

Hi. There is a problem with the EnumFieldItem that comes out when using Inspect (). The EnumFieldItem script only uses the KeyCode. So I am using the value property and Init method after modifying it.

public override object value {   get   {    //return Convert.ChangeType( Enum.Parse( typeof(KeyCode),dropdown.captionText.text), typeof(KeyCode) );    return Convert.ChangeType( Enum.Parse( preValue.GetType(),dropdown.captionText.text), preValue.GetType() );   }   protected set   {     .....   } }

void Init() {   //fieldType = typeof(KeyCode);   var currentValue = componentType.GetField(fieldName).GetValue(component);   fieldType = currentValue.GetType(); }

I hope to fix this in a later version. Thank you.

hecomi commented 6 years ago

Thank you for the report. I've fixed this bug and will include it in the next release.

hecomi commented 6 years ago

Released: https://github.com/hecomi/uREPL/releases/tag/v0.5.1