コード例 #1
0
        private void DrawReviewStage()
        {
            EditorGUILayout.LabelField("Review", EditorStyles.boldLabel);
            EditorWindowTools.StartIndentedSection();
            EditorGUILayout.HelpBox("Your Player is ready! Below is a summary of the configuration.\n\nPlayer configuration can sometimes be complex. This wizard can't anticipate every possible character design. If your player doesn't behave the way you expect, " +
                                    "please examine the components on the player and make adjustments as necessary. Often, you may need to add additional gameplay components, such as your own controller or camera scripts, to the Set Component Enabled On Dialogue Event component in the Gameplay/Conversation Transition section.", MessageType.Info);
            var simpleController     = pcObject.GetComponent <PixelCrushers.DialogueSystem.Demo.SimpleController>();
            var navigateOnMouseClick = pcObject.GetComponent <PixelCrushers.DialogueSystem.Demo.NavigateOnMouseClick>();

            if (simpleController != null)
            {
                EditorGUILayout.LabelField("Control: Third-Person Shooter Style");
            }
            else if (navigateOnMouseClick != null)
            {
                EditorGUILayout.LabelField("Control: Follow Mouse Clicks");
            }
            else
            {
                EditorGUILayout.LabelField("Control: Custom");
            }
            switch (GetSelectorType())
            {
            case SelectorType.CenterOfScreen: EditorGUILayout.LabelField("Targeting: Center of Screen"); break;

            case SelectorType.CustomPosition: EditorGUILayout.LabelField("Targeting: Custom Position (you must set Selector.CustomPosition)"); break;

            case SelectorType.MousePosition: EditorGUILayout.LabelField("Targeting: Mouse Position"); break;

            case SelectorType.Proximity: EditorGUILayout.LabelField("Targeting: Proximity"); break;

            default: EditorGUILayout.LabelField("Targeting: None"); break;
            }
            SetComponentEnabledOnDialogueEvent enabler = FindConversationEnabler();

            if (enabler != null)
            {
                ShowDisabledComponents(enabler.onStart);
            }
            ShowCursorOnConversation showCursor = pcObject.GetComponentInChildren <ShowCursorOnConversation>();

            if (showCursor != null)
            {
                EditorGUILayout.LabelField("Show Cursor During Conversations: Yes");
            }
            var positionSaver = pcObject.GetComponentInChildren <PositionSaver>();

            EditorGUILayout.LabelField(string.Format("Save Position: {0}", (positionSaver != null) ? "Yes" : "No"));
            EditorWindowTools.EndIndentedSection();
            DrawNavigationButtons(true, true, true);
        }
コード例 #2
0
        private void DrawReviewStage()
        {
            EditorGUILayout.LabelField("Review", EditorStyles.boldLabel);
            EditorWindowTools.StartIndentedSection();
            EditorGUILayout.HelpBox("Your Player is ready! Below is a summary of the configuration.", MessageType.Info);
            SimpleController     simpleController     = pcObject.GetComponent <SimpleController>();
            NavigateOnMouseClick navigateOnMouseClick = pcObject.GetComponent <NavigateOnMouseClick>();

            if (simpleController != null)
            {
                EditorGUILayout.LabelField("Control: Third-Person Shooter Style");
            }
            else if (navigateOnMouseClick != null)
            {
                EditorGUILayout.LabelField("Control: Follow Mouse Clicks");
            }
            else
            {
                EditorGUILayout.LabelField("Control: Custom");
            }
            switch (GetSelectorType())
            {
            case SelectorType.CenterOfScreen: EditorGUILayout.LabelField("Targeting: Center of Screen"); break;

            case SelectorType.CustomPosition: EditorGUILayout.LabelField("Targeting: Custom Position (you must set Selector.CustomPosition)"); break;

            case SelectorType.MousePosition: EditorGUILayout.LabelField("Targeting: Mouse Position"); break;

            case SelectorType.Proximity: EditorGUILayout.LabelField("Targeting: Proximity"); break;

            default: EditorGUILayout.LabelField("Targeting: None"); break;
            }
            SetComponentEnabledOnDialogueEvent enabler = FindConversationEnabler();

            if (enabler != null)
            {
                ShowDisabledComponents(enabler.onStart);
            }
            ShowCursorOnConversation showCursor = pcObject.GetComponentInChildren <ShowCursorOnConversation>();

            if (showCursor != null)
            {
                EditorGUILayout.LabelField("Show Cursor During Conversations: Yes");
            }
            PersistentPositionData persistentPositionData = pcObject.GetComponentInChildren <PersistentPositionData>();

            EditorGUILayout.LabelField(string.Format("Save Position: {0}", (persistentPositionData != null) ? "Yes" : "No"));
            EditorWindowTools.EndIndentedSection();
            DrawNavigationButtons(true, true, true);
        }
コード例 #3
0
        private void DrawDisableControlsSection()
        {
            EditorWindowTools.StartIndentedSection();
            SetComponentEnabledOnDialogueEvent enabler = FindConversationEnabler();

            if (setEnabledFlag)
            {
                if (enabler == null)
                {
                    enabler = pcObject.AddComponent(TypeUtility.GetWrapperType(typeof(PixelCrushers.DialogueSystem.SetComponentEnabledOnDialogueEvent))) as SetComponentEnabledOnDialogueEvent;
                }
                enabler.trigger = DialogueEvent.OnConversation;
                enabler.onStart = GetPlayerControls(enabler.onStart, Toggle.False);
                enabler.onEnd   = GetPlayerControls(enabler.onEnd, Toggle.True);
                ShowDisabledComponents(enabler.onStart);
            }
            else
            {
                DestroyImmediate(enabler);
            }
            EditorWindowTools.EndIndentedSection();
        }
コード例 #4
0
        private void DrawDisableControlsSection()
        {
            EditorWindowTools.StartIndentedSection();
            SetComponentEnabledOnDialogueEvent enabler = FindConversationEnabler();

            if (setEnabledFlag)
            {
                if (enabler == null)
                {
                    enabler = pcObject.AddComponent <SetComponentEnabledOnDialogueEvent>();
                }
                enabler.trigger = DialogueEvent.OnConversation;
                enabler.onStart = GetPlayerControls(enabler.onStart, Toggle.False);
                enabler.onEnd   = GetPlayerControls(enabler.onEnd, Toggle.True);
                ShowDisabledComponents(enabler.onStart);
            }
            else
            {
                DestroyImmediate(enabler);
            }
            EditorWindowTools.EndIndentedSection();
        }
コード例 #5
0
        private void DrawTransitionStage()
        {
            EditorGUILayout.LabelField("Gameplay/Conversation Transition", EditorStyles.boldLabel);
            EditorWindowTools.StartIndentedSection();
            SetComponentEnabledOnDialogueEvent setEnabled = pcObject.GetComponent <SetComponentEnabledOnDialogueEvent>();

            setEnabledFlag = setEnabledFlag || (setEnabled != null);
            if (!setEnabledFlag)
            {
                EditorGUILayout.HelpBox("Gameplay components, such as movement and camera control, will interfere with conversations. If you want to disable gameplay components during conversations, tick the checkbox below. There are many ways to disable gameplay components. You can add a Dialogue System Events component and configure it in the inspector, or add Dialogue System Triggers set to OnConversationStart and OnConversationEnd. Or you can add a Set Component Enabled On Dialogue Event component, which is what the checkbox below does.", MessageType.None);
            }
            EditorGUILayout.BeginHorizontal();
            setEnabledFlag = EditorGUILayout.Toggle(setEnabledFlag, GUILayout.Width(ToggleWidth));
            EditorGUILayout.LabelField("Add Set Component Enabled On Dialogue Event component", EditorStyles.boldLabel);
            EditorGUILayout.EndHorizontal();
            DrawDisableControlsSection();
            DrawShowCursorSection();
            if (GUILayout.Button("Select Player", GUILayout.Width(100)))
            {
                Selection.activeGameObject = pcObject;
            }
            EditorWindowTools.EndIndentedSection();
            DrawNavigationButtons(true, true, false);
        }
コード例 #6
0
        private void DrawTransitionStage()
        {
            EditorGUILayout.LabelField("Gameplay/Conversation Transition", EditorStyles.boldLabel);
            EditorWindowTools.StartIndentedSection();
            SetComponentEnabledOnDialogueEvent setEnabled = pcObject.GetComponent <SetComponentEnabledOnDialogueEvent>();

            setEnabledFlag = setEnabledFlag || (setEnabled != null);
            if (!setEnabledFlag)
            {
                EditorGUILayout.HelpBox("Gameplay components, such as movement and camera control, will interfere with conversations. If you want to disable gameplay components during conversations, tick the checkbox below.", MessageType.None);
            }
            EditorGUILayout.BeginHorizontal();
            setEnabledFlag = EditorGUILayout.Toggle(setEnabledFlag, GUILayout.Width(ToggleWidth));
            EditorGUILayout.LabelField("Disable gameplay components during conversations", EditorStyles.boldLabel);
            EditorGUILayout.EndHorizontal();
            DrawDisableControlsSection();
            DrawShowCursorSection();
            if (GUILayout.Button("Select Player", GUILayout.Width(100)))
            {
                Selection.activeGameObject = pcObject;
            }
            EditorWindowTools.EndIndentedSection();
            DrawNavigationButtons(true, true, false);
        }