Ejemplo n.º 1
0
        override public void ShowGUI(List <ActionParameter> parameters)
        {
            UpgradeSelf();

            isPlayer = EditorGUILayout.Toggle("Is Player?", isPlayer);

            if (!isPlayer)
            {
                charToMoveParameterID = Action.ChooseParameterGUI("Character to move:", parameters, charToMoveParameterID, ParameterType.GameObject);
                if (charToMoveParameterID >= 0)
                {
                    charToMoveID = 0;
                    charToMove   = null;
                }
                else
                {
                    charToMove = (Char)EditorGUILayout.ObjectField("Character to move:", charToMove, typeof(Char), true);

                    charToMoveID = FieldToID <Char> (charToMove, charToMoveID);
                    charToMove   = IDToField <Char> (charToMove, charToMoveID, false);
                }
            }

            movePathMethod = (MovePathMethod)EditorGUILayout.EnumPopup("Method:", movePathMethod);
            if (movePathMethod == MovePathMethod.MoveOnNewPath)
            {
                movePathParameterID = Action.ChooseParameterGUI("Path to follow:", parameters, movePathParameterID, ParameterType.GameObject);
                if (movePathParameterID >= 0)
                {
                    movePathID = 0;
                    movePath   = null;
                }
                else
                {
                    movePath = (Paths)EditorGUILayout.ObjectField("Path to follow:", movePath, typeof(Paths), true);

                    movePathID = FieldToID <Paths> (movePath, movePathID);
                    movePath   = IDToField <Paths> (movePath, movePathID, false);
                }

                doTeleport = EditorGUILayout.Toggle("Teleport to start?", doTeleport);
                willWait   = EditorGUILayout.Toggle("Wait until finish?", willWait);

                if (movePath != null && movePath.GetComponent <Char>())
                {
                    EditorGUILayout.HelpBox("Can't follow a Path attached to a Character!", MessageType.Warning);
                }
            }
            else if (movePathMethod == MovePathMethod.ResumeLastSetPath)
            {
                //
            }

            AfterRunningOption();
        }
Ejemplo n.º 2
0
        private void UpgradeSelf()
        {
            if (!doStop)
            {
                return;
            }

            doStop         = false;
            movePathMethod = MovePathMethod.StopMoving;

            if (Application.isPlaying)
            {
                Debug.Log("'Character: Move along path' Action has been temporarily upgraded - - please view it's Inspector when the game ends and save the scene.");
            }
            else
            {
                Debug.Log("Upgraded 'Character: Move along path' Action, please save the scene.");
            }
        }
Ejemplo n.º 3
0
		private void UpgradeSelf ()
		{
			if (!doStop)
			{
				return;
			}

			doStop = false;
			movePathMethod = MovePathMethod.StopMoving;
			
			if (Application.isPlaying)
			{
				Debug.Log ("'Character: Move along path' Action has been temporarily upgraded - - please view it's Inspector when the game ends and save the scene.");
			}
			else
			{
				Debug.Log ("Upgraded 'Character: Move along path' Action, please save the scene.");
			}
		}
Ejemplo n.º 4
0
        public override void ShowGUI(List<ActionParameter> parameters)
        {
            UpgradeSelf ();

            isPlayer = EditorGUILayout.Toggle ("Is Player?", isPlayer);

            if (!isPlayer)
            {
                charToMoveParameterID = Action.ChooseParameterGUI ("Character to move:", parameters, charToMoveParameterID, ParameterType.GameObject);
                if (charToMoveParameterID >= 0)
                {
                    charToMoveID = 0;
                    charToMove = null;
                }
                else
                {
                    charToMove = (Char) EditorGUILayout.ObjectField ("Character to move:", charToMove, typeof (Char), true);

                    charToMoveID = FieldToID <Char> (charToMove, charToMoveID);
                    charToMove = IDToField <Char> (charToMove, charToMoveID, false);
                }
            }

            movePathMethod = (MovePathMethod) EditorGUILayout.EnumPopup ("Method:", movePathMethod);
            if (movePathMethod == MovePathMethod.MoveOnNewPath)
            {
                movePathParameterID = Action.ChooseParameterGUI ("Path to follow:", parameters, movePathParameterID, ParameterType.GameObject);
                if (movePathParameterID >= 0)
                {
                    movePathID = 0;
                    movePath = null;
                }
                else
                {
                    movePath = (Paths) EditorGUILayout.ObjectField ("Path to follow:", movePath, typeof(Paths), true);

                    movePathID = FieldToID <Paths> (movePath, movePathID);
                    movePath = IDToField <Paths> (movePath, movePathID, false);
                }

                doTeleport = EditorGUILayout.Toggle ("Teleport to start?", doTeleport);
                if (movePath != null && movePath.pathType != AC_PathType.ForwardOnly)
                {
                    willWait = false;
                }
                else
                {
                    willWait = EditorGUILayout.Toggle ("Wait until finish?", willWait);
                }

                if (movePath != null && movePath.GetComponent <Char>())
                {
                    EditorGUILayout.HelpBox ("Can't follow a Path attached to a Character!", MessageType.Warning);
                }
            }
            else if (movePathMethod == MovePathMethod.ResumeLastSetPath)
            {
                //
            }

            AfterRunningOption ();
        }
Ejemplo n.º 5
0
        public override void ShowGUI(List <ActionParameter> parameters)
        {
            isPlayer = EditorGUILayout.Toggle("Is Player?", isPlayer);

            if (isPlayer)
            {
                if (KickStarter.settingsManager != null && KickStarter.settingsManager.playerSwitching == PlayerSwitching.Allow)
                {
                    playerParameterID = ChooseParameterGUI("Player ID:", parameters, playerParameterID, ParameterType.Integer);
                    if (playerParameterID < 0)
                    {
                        playerID = ChoosePlayerGUI(playerID, true);
                    }
                }
            }
            else
            {
                charToMoveParameterID = ChooseParameterGUI("Character to move:", parameters, charToMoveParameterID, ParameterType.GameObject);
                if (charToMoveParameterID >= 0)
                {
                    charToMoveID = 0;
                    charToMove   = null;
                }
                else
                {
                    charToMove = (Char)EditorGUILayout.ObjectField("Character to move:", charToMove, typeof(Char), true);

                    charToMoveID = FieldToID <Char> (charToMove, charToMoveID);
                    charToMove   = IDToField <Char> (charToMove, charToMoveID, false);
                }
            }

            movePathMethod = (MovePathMethod)EditorGUILayout.EnumPopup("Method:", movePathMethod);
            if (movePathMethod == MovePathMethod.MoveOnNewPath)
            {
                movePathParameterID = Action.ChooseParameterGUI("Path to follow:", parameters, movePathParameterID, ParameterType.GameObject);
                if (movePathParameterID >= 0)
                {
                    movePathID = 0;
                    movePath   = null;
                }
                else
                {
                    movePath = (Paths)EditorGUILayout.ObjectField("Path to follow:", movePath, typeof(Paths), true);

                    movePathID = FieldToID <Paths> (movePath, movePathID);
                    movePath   = IDToField <Paths> (movePath, movePathID, false);
                }

                if (movePath != null && movePath.pathType == AC_PathType.IsRandom)
                {
                    startRandom = EditorGUILayout.Toggle("Start at random node?", startRandom);
                }

                doTeleport = EditorGUILayout.Toggle("Teleport to start?", doTeleport);
                if (movePath != null && movePath.pathType != AC_PathType.ForwardOnly && movePath.pathType != AC_PathType.ReverseOnly)
                {
                    willWait = false;
                }
                else
                {
                    willWait = EditorGUILayout.Toggle("Wait until finish?", willWait);
                }

                if (movePath != null && movePath.GetComponent <Char>())
                {
                    EditorGUILayout.HelpBox("Can't follow a Path attached to a Character!", MessageType.Warning);
                }
            }
            else if (movePathMethod == MovePathMethod.StopMoving)
            {
                stopInstantly = EditorGUILayout.Toggle("Stop instantly?", stopInstantly);
            }
            else if (movePathMethod == MovePathMethod.ResumeLastSetPath)
            {
                //
            }

            AfterRunningOption();
        }