Exemplo n.º 1
0
            public override void ParseAndSet(object instance, string text)
            {
                if (!_isParseable)
                {
                    throw new InvalidOperationException("Field does not support text input");
                }

                object value = ParsingUtils.Parse(_fieldInfo.FieldType, text);

                SetValue(instance, value);
            }
        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
            }
        }