Ejemplo n.º 1
0
        public override void DrawCommandGUI()
        {
            serializedObject.Update();

            AddOption t = target as AddOption;

            EditorGUILayout.PropertyField(optionTextProp, new GUIContent("Option Text", "Text to display on the option button."));

            SequenceEditor.SequenceField(targetSequenceProp,
                                         new GUIContent("Target Sequence", "Sequence to execute when this option is selected by the player."),
                                         new GUIContent("<Continue>"),
                                         t.GetFungusScript());

            EditorGUILayout.PropertyField(hideOnSelectedProp, new GUIContent("Hide On Selected", "Hide this option forever once the player has selected it."));

            serializedObject.ApplyModifiedProperties();
        }
Ejemplo n.º 2
0
        public override void DrawCommandGUI()
        {
            serializedObject.Update();

            Call t = target as Call;

            FungusScript fungusScript = t.GetFungusScript();

            if (fungusScript == null)
            {
                return;
            }

            SequenceEditor.SequenceField(targetSequenceProp,
                                         new GUIContent("Target Sequence", "Sequence to call"),
                                         new GUIContent("<Continue>"),
                                         fungusScript);

            serializedObject.ApplyModifiedProperties();
        }
Ejemplo n.º 3
0
        public override void DrawCommandGUI()
        {
            FungusScript fungusScript = FungusScriptWindow.GetFungusScript();

            if (fungusScript == null)
            {
                return;
            }

            serializedObject.Update();

            EditorGUILayout.PropertyField(durationProp);

            SequenceEditor.SequenceField(targetSequenceProp,
                                         new GUIContent("Target Sequence", "Sequence to call when timer expires"),
                                         new GUIContent("<None>"),
                                         fungusScript);

            serializedObject.ApplyModifiedProperties();
        }
Ejemplo n.º 4
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            FungusScript t = target as FungusScript;

            t.UpdateHideFlags();

            if (Application.isPlaying)
            {
                if (t.executingSequence == null)
                {
                    t.selectedCommand = null;
                }
                else
                {
                    t.selectedCommand = t.executingSequence.activeCommand;
                }
            }

            EditorGUILayout.PropertyField(stepTimeProp, new GUIContent("Step Time", "Minimum time to execute each step"));

            SequenceEditor.SequenceField(startSequenceProp,
                                         new GUIContent("Start Sequence", "Sequence to be executed when controller starts."),
                                         new GUIContent("<None>"),
                                         t);

            if (t.startSequence == null)
            {
                GUIStyle style = new GUIStyle(GUI.skin.label);
                style.normal.textColor = new Color(1, 0, 0);
                EditorGUILayout.LabelField(new GUIContent("Error: Please select a Start Sequence"), style);
            }

            EditorGUILayout.PropertyField(executeOnStartProp, new GUIContent("Execute On Start", "Execute this Fungus Script when the scene starts."));

            EditorGUILayout.PropertyField(colorCommandsProp, new GUIContent("Color Commands", "Display commands using colors in editor window."));

            EditorGUILayout.PropertyField(showSequenceObjectsProp, new GUIContent("Show Sequence Objects", "Display the child Sequence game objects in the hierarchy view."));

            EditorGUILayout.Separator();

            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Open Editor"))
            {
                EditorWindow.GetWindow(typeof(FungusScriptWindow), false, "Fungus Script");
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            EditorGUILayout.Separator();

            if (t.selectedCommand != null)
            {
                CommandEditor commandEditor = Editor.CreateEditor(t.selectedCommand) as CommandEditor;
                commandEditor.DrawCommandInspectorGUI();
                DestroyImmediate(commandEditor);
            }

            EditorGUILayout.Separator();

            DrawVariablesGUI();

            serializedObject.ApplyModifiedProperties();
        }