public override void OnInspectorGUI() { // Configuration: bool _isDecisionNode = EditorGUILayout.Toggle("Decision node?", node.isDecisionNode); GameObject[] _objectsToTrigger = PrairieGUI.drawObjectList("Objects To Trigger", node.objectsToTrigger); EditorGUILayout.LabelField("Name", node.name); EditorGUILayout.LabelField("Content"); EditorGUI.indentLevel += 1; string _content = EditorGUILayout.TextArea(node.content); EditorGUI.indentLevel -= 1; // Read-Only Display: PrairieGUI.drawObjectListReadOnly("Children", node.children); PrairieGUI.drawObjectListReadOnly("Parents", node.parents.ToArray()); // Save changes to the TwineNode if the user edits something in the GUI: if (GUI.changed) { Undo.RecordObject(node, "Modify Twine Node"); node.isDecisionNode = _isDecisionNode; node.objectsToTrigger = _objectsToTrigger; node.content = _content; } }
public override void OnInspectorGUI() { // Configuration: EditorGUILayout.LabelField("Name", node.name); EditorGUILayout.LabelField("Content"); EditorGUI.indentLevel += 1; string _content = EditorGUILayout.TextArea(node.content); EditorGUI.indentLevel -= 1; bool _isDecisionNode = EditorGUILayout.Toggle("Decision node?", node.isDecisionNode); GameObject[] _objectsToTrigger = PrairieGUI.drawObjectList("Objects To Trigger", node.objectsToTrigger); GameObject[] _objectsToEnable = PrairieGUI.drawObjectList <GameObject>("Objects To Enable:", node.objectsToEnable); GameObject[] _objectsToRotate = PrairieGUI.drawObjectList <GameObject>("Objects To Rotate:", node.objectsToRotate); int _rotX = EditorGUILayout.IntField("X-axis rotation amount:", node.rotX); int _rotY = EditorGUILayout.IntField("Y-axis rotation amount:", node.rotY); int _rotZ = EditorGUILayout.IntField("Z-axis rotation amount:", node.rotZ); GameObject[] _objectsToTransform = PrairieGUI.drawObjectList <GameObject>("Objects To Transform:", node.objectsToTransform); int _trX = EditorGUILayout.IntField("X-axis transform amount:", node.trX); int _trY = EditorGUILayout.IntField("Y-axis transform amount:", node.trY); int _trZ = EditorGUILayout.IntField("Z-axis transform amount:", node.trZ); // Read-Only Display: PrairieGUI.drawObjectListReadOnly("Children", node.children); PrairieGUI.drawObjectListReadOnly("Parents", node.parents.ToArray()); // Save changes to the TwineNode if the user edits something in the GUI: if (GUI.changed) { Undo.RecordObject(node, "Modify Twine Node"); node.isDecisionNode = _isDecisionNode; node.objectsToTrigger = _objectsToTrigger; node.content = _content; node.objectsToEnable = _objectsToEnable; node.objectsToRotate = _objectsToRotate; node.objectsToTransform = _objectsToTransform; node.trX = _trX; node.trY = _trY; node.trZ = _trZ; node.rotX = _rotX; node.rotY = _rotY; node.rotZ = _rotZ; } }
public override void OnInspectorGUI() { // Configuration: bool _repeatable = EditorGUILayout.Toggle("Repeatable?", componentToggle.repeatable); GameObject[] _targets = PrairieGUI.drawObjectList <GameObject> ("Objects To Enable/Disable:", componentToggle.targets); // Save: if (GUI.changed) { Undo.RecordObject(componentToggle, "Modify Component Rotation"); componentToggle.repeatable = _repeatable; componentToggle.targets = _targets; } // Warnings (after properties have been updated): this.DrawWarnings(); }
public override void OnInspectorGUI() { // Principle Configuration: bool _repeatable = EditorGUILayout.Toggle("Repeatable?", trigger.repeatable); GameObject[] _triggeredObjects = PrairieGUI.drawObjectList <GameObject> ("Trigger Objects:", trigger.triggeredObjects); // Save Changes: if (GUI.changed) { Undo.RecordObject(trigger, "Modify Trigger"); trigger.repeatable = _repeatable; trigger.triggeredObjects = _triggeredObjects; } // Warnings (after properties have been updated): this.DrawWarnings(); }
public override void OnInspectorGUI() { slideshow = (Slideshow)target; slideshow.Slides = PrairieGUI.drawObjectList("Slides", slideshow.Slides); for (int i = 0; i < slideshow.Slides.Length; i++) { if (slideshow.Slides [i] == null) { DrawWarnings(); break; } } if (GUI.changed) { EditorUtility.SetDirty(slideshow); } }
public override void OnInspectorGUI() { // Configuration: bool _repeatable = EditorGUILayout.Toggle("Repeatable?", componentToggle.repeatable); GameObject[] _targets = PrairieGUI.drawObjectList <GameObject> ("Objects To Transform:", componentToggle.targets); int _trX = EditorGUILayout.IntField("X-axis transl amount:", componentToggle.trX); int _trY = EditorGUILayout.IntField("Y-axis transl amount:", componentToggle.trY); int _trZ = EditorGUILayout.IntField("Z-axis transl amount:", componentToggle.trZ); // Save: if (GUI.changed) { Undo.RecordObject(componentToggle, "Modify Component Translation"); componentToggle.repeatable = _repeatable; componentToggle.targets = _targets; componentToggle.trX = _trX; componentToggle.trY = _trY; componentToggle.trZ = _trZ; } // Warnings (after properties have been updated): this.DrawWarnings(); }