Esempio n. 1
0
        void GameStartSnapToCentre(GAME_START_MODE gameStartMode)
        {
            Quaternion q = transform.localRotation;

            switch (gameStartMode)
            {
            case GAME_START_MODE.STOP:
                q.eulerAngles = defaultStop;
                break;

            case GAME_START_MODE.INTO_BATTLE:
                q.eulerAngles = defaultInToBattle;
                break;

            case GAME_START_MODE.SABATICAL_MODE:
                q.eulerAngles = defaultSabatical;
                break;

            case GAME_START_MODE.NONE:
                q.eulerAngles = defaultNone;
                break;
            }

            transform.localRotation = q;
            if (audioSource != null)
            {
                audioSource.Play();
            }
            // podiumManager.SendGameModeToGameController();
        }
Esempio n. 2
0
        /// <summary>
        /// Checks the value that the GAME START PODIUM lever points to. If it is in the GO section, then it use the values of the other levers to load a game
        /// </summary>
        private void SelectGameStart()
        {
            if (leverType == LEVERTYPE.GAME_START)
            {
                angle = gameObject.transform.localRotation.eulerAngles;
                if (angle.x <= 74.6 && angle.x >= 57.2)
                {
                    if (angle.y >= 160.0 && angle.y <= 195.0)
                    {
                        //gameStartMode = GAME_START_MODE.INTO_BATTLE;
                        if (podiumManager.CheckIsCurrentMissionUnlocked()) //Only try load level if the level is unlocked
                        {
                            gameStartMode = GAME_START_MODE.GO;
                            Invoke("AttemptToLoadLevel", 0.5f);
                        }
                        else
                        {
                            gameStartMode = GAME_START_MODE.STOP;
                        }
                    }
                }

                if (angle.x <= 57.1 && angle.x >= 0.0)
                {
                    if (angle.y >= 160.0 && angle.y <= 195.0)
                    {
                        //gameStartMode = GAME_START_MODE.NONE; //This is the section that says "Bellingers Telegraph".
                        if (podiumManager.CheckIsCurrentMissionUnlocked()) //Only try load level if the level is unlocked
                        {
                            gameStartMode = GAME_START_MODE.GO;
                            Invoke("AttemptToLoadLevel", 0.5f);
                        }
                        else
                        {
                            gameStartMode = GAME_START_MODE.STOP;
                        }
                    }
                }

                if (angle.x <= 359.9 && angle.x >= 302.1)
                {
                    if (angle.y >= 160.0 && angle.y <= 195.0)
                    {
                        // gameStartMode = GAME_START_MODE.NONE;//This is the section that says "Bellingers Telegraph".
                        gameStartMode = GAME_START_MODE.STOP;
                    }
                }

                if (angle.x <= 302.0 && angle.x >= 287.0)
                {
                    if (angle.y >= 160.0 && angle.y <= 195.0)
                    {
                        // gameStartMode = GAME_START_MODE.SABATICAL_MODE;
                        gameStartMode = GAME_START_MODE.STOP;
                    }
                }

                if (angle.x <= 286.9 && angle.x >= 270.2)
                {
                    if (angle.y >= 160.0 && angle.y <= 195.0)
                    {
                        gameStartMode = GAME_START_MODE.STOP;
                    }
                }

                if (angle.x >= 270.2 && angle.x <= 279.1)
                {
                    if (angle.y >= -15.0 && angle.y <= 15.0)
                    {
                        gameStartMode = GAME_START_MODE.STOP;
                    }
                }

                if (angle.x >= 279.3 && angle.x <= 359.9)
                {
                    if (angle.y >= -15.0 && angle.y <= 15.0)
                    {
                        if (podiumManager.CheckIsCurrentMissionUnlocked()) //Only try load level if the level is unlocked
                        {
                            gameStartMode = GAME_START_MODE.GO;
                            Invoke("AttemptToLoadLevel", 0.5f);
                        }
                        else
                        {
                            gameStartMode = GAME_START_MODE.STOP;
                        }
                    }
                }

                if (angle.x >= 0.0 && angle.x <= 89.9)
                {
                    if (angle.y >= -15.0 && angle.y <= 15.0)
                    {
                        if (podiumManager.CheckIsCurrentMissionUnlocked()) //Only try load level if the level is unlocked
                        {
                            gameStartMode = GAME_START_MODE.GO;
                            Invoke("AttemptToLoadLevel", 0.5f);
                        }
                        else
                        {
                            gameStartMode = GAME_START_MODE.STOP;
                        }
                    }
                }

                if (angle.x <= 90.0 && angle.x >= 74.7)
                {
                    if (angle.y >= 160.0 && angle.y <= 195.0)
                    {
                        if (podiumManager.CheckIsCurrentMissionUnlocked()) //Only try load level if the level is unlocked
                        {
                            gameStartMode = GAME_START_MODE.GO;
                            Invoke("AttemptToLoadLevel", 0.5f);
                        }
                        else
                        {
                            gameStartMode = GAME_START_MODE.STOP;
                        }
                    }
                }
                GameStartSnapToCentre(gameStartMode);
            }
        }