private bool CheckIfParseable()
        {
            ScriptScope scope     = _prefabPythonObject.ScriptScope;
            Type        type      = scope.GetVariable(_fieldName).GetType();
            bool        parseable = ParsingUtils.IsTextParseable(type);

            return(parseable);
        }
        public override void ParseAndSet(object instance, string text)
        {
            Type type = _prefabPythonObject.ScriptScope.GetVariable(_fieldName).GetType();

            if (ParsingUtils.IsTextParseable(type))
            {
                object value = ParsingUtils.Parse(type, text);
                SetValue(instance, value);
            }
            else
            {
                // TODO Throw exception
            }
        }
Exemplo n.º 3
0
 public AssemblyFieldDescriptor(FieldInfo fieldInfo)
 {
     _fieldInfo   = fieldInfo;
     _isParseable = ParsingUtils.IsTextParseable(fieldInfo.FieldType);
 }