Beispiel #1
0
 private void DrawNavigateOnMouseClickSection(NavigateOnMouseClick navigateOnMouseClick)
 {
     EditorWindowTools.StartIndentedSection();
     if ((navigateOnMouseClick.idle == null) || (navigateOnMouseClick.run == null))
     {
         EditorGUILayout.HelpBox("The player clicks on the map to move. At a minimum, Idle and Run animations are required. Click Select Player to customize further.", MessageType.Info);
     }
     navigateOnMouseClick.idle        = EditorGUILayout.ObjectField("Idle Animation", navigateOnMouseClick.idle, typeof(AnimationClip), false) as AnimationClip;
     navigateOnMouseClick.run         = EditorGUILayout.ObjectField("Run Animation", navigateOnMouseClick.run, typeof(AnimationClip), false) as AnimationClip;
     navigateOnMouseClick.mouseButton = (NavigateOnMouseClick.MouseButtonType)EditorGUILayout.EnumPopup("Mouse Button", navigateOnMouseClick.mouseButton);
     EditorWindowTools.EndIndentedSection();
 }
Beispiel #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;
            }
            SetEnabledOnDialogueEvent 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);
        }
Beispiel #3
0
        private void DrawControlStage()
        {
            EditorGUILayout.LabelField("Control", EditorStyles.boldLabel);
            EditorWindowTools.StartIndentedSection();
            SimpleController     simpleController     = pcObject.GetComponent <SimpleController>();
            NavigateOnMouseClick navigateOnMouseClick = pcObject.GetComponent <NavigateOnMouseClick>();
            ControlStyle         controlStyle         = (simpleController != null)
                                ? ControlStyle.ThirdPersonShooter
                                : (navigateOnMouseClick != null)
                                        ? ControlStyle.FollowMouseClicks
                                        : ControlStyle.Custom;

            EditorGUILayout.HelpBox("How will the player control movement? (Select Custom to provide your own control components instead of using the Dialogue System's.)", MessageType.Info);
            controlStyle = (ControlStyle)EditorGUILayout.EnumPopup("Control", controlStyle);
            switch (controlStyle)
            {
            case ControlStyle.ThirdPersonShooter:
                DestroyImmediate(navigateOnMouseClick);
                DrawSimpleControllerSection(simpleController ?? pcObject.AddComponent <SimpleController>());
                break;

            case ControlStyle.FollowMouseClicks:
                DestroyImmediate(simpleController);
                DrawNavigateOnMouseClickSection(navigateOnMouseClick ?? pcObject.AddComponent <NavigateOnMouseClick>());
                break;

            default:
                DestroyImmediate(simpleController);
                DestroyImmediate(navigateOnMouseClick);
                break;
            }
            if (GUILayout.Button("Select Player", GUILayout.Width(100)))
            {
                Selection.activeGameObject = pcObject;
            }
            EditorWindowTools.EndIndentedSection();
            DrawNavigationButtons(true, true, false);
        }