public override void OnInspectorGUI() { // Draw the default inspector base.OnInspectorGUI(); AnimationTemplateGraph template = (AnimationTemplateGraph)serializedObject.FindProperty("_templateGraph").objectReferenceValue; if (template.CurrentError != AnimationTemplateGraph.Error.None) { EditorGUILayout.HelpBox("Invalid Template, Please check the template for any errors", MessageType.Error); return; } var tweenTemplate = ((TweenTemplate)target); if (tweenTemplate.Values == null) { tweenTemplate.Values = new object[template.nodes.Count]; } for (var i = 0; i < template.nodes.Count; i++) { var editor = CreateEditor(template.nodes[i]); var value = editor.serializedObject.FindProperty("Value"); if (value != null) { if (value.propertyType == SerializedPropertyType.ObjectReference) { tweenTemplate.Values[i] = EditorGUILayout.ObjectField( editor.serializedObject.FindProperty("Name").stringValue, (Object)tweenTemplate.Values[i], GetType(value), true); } else { Debug.Log(value.propertyType); DefaultProperty(value.propertyType, editor.serializedObject.FindProperty("Name").stringValue, ref tweenTemplate.Values[i]); } } } }
public override void OnGUI() { _templateGraph = (AnimationTemplateGraph)target; DrawErrors(); }