예제 #1
0
        public override void OnGUI(GUIContent label)
        {
            base.OnGUI(label);
            ICZType c = Value as ICZType;

            c.SetValue(EditorGUILayoutExtension.DrawField(label, c.ValueType, c.GetValue()));
        }
        public override void OnInspectorGUI()
        {
            EditorGUI.BeginChangeCheck();

            if (Target is BaseGraphElement graphElement)
            {
                foreach (var property in graphElement.BindableProperties)
                {
                    if (IgnoreProperty.Contains(property.Key))
                    {
                        continue;
                    }

                    property.Value.ValueBoxed = EditorGUILayoutExtension.DrawField(property.Key, property.Value.ValueType, property.Value.ValueBoxed);
                }
            }

            if (EditorGUI.EndChangeCheck())
            {
            }
        }
        public override void OnGUI(GUIContent label)
        {
            SharedVariable variable      = Value as SharedVariable;
            IVariableOwner variableOwner = variable.VariableOwner;

            if (variableOwner == null)
            {
                EditorGUILayout.HelpBox("没有VariableOwner", MessageType.Error); return;
            }
            //EditorGUILayout.HelpBox("ReferenceType:" + variable.GUID, MessageType.Info);
            //if (variableOwner.GetVariable(variable.GUID) == null)
            //    variableOwner.SetVariable(variable.Clone() as SharedVariable);
            EditorGUI.BeginChangeCheck();
            object value = EditorGUILayoutExtension.DrawField(label, variable.GetValueType(), variable.GetValue());

            if (EditorGUI.EndChangeCheck())
            {
                variable.SetValue(value);
                EditorUtility.SetDirty(variableOwner.Self());
            }
        }