Пример #1
0
    private void Start()
    {
        CharacterChecks();

        Default_MovementSpeed = MovementSpeed;
        //HP
        PlayerUIs.HealthPoints = HealthPoints;

        _HealthPoints = HealthPoints;

        if (SEM == null)
        {
            SEM = Behaviour.FindObjectOfType <ScreenEffectsManager>();
        }

        //Name'
        if (Game_GlobalInfo.singleton)
        {
            PlayerName = Game_GlobalInfo.singleton.Player_Username;
        }
        else
        {
            PlayerName = "Error404";
        }


        PlayerUIs.PlayerName_Text.text = PlayerName;
    }
 private void Awake()
 {
     SEM                = this;
     AlphaMax           = AlphaMax / 255;
     CurrentAlphaAmount = RedScreen.color.a;
     C = RedScreen.color;
 }
Пример #3
0
 void Update()
 {
     if (Input.GetButtonDown("A_1") || Input.GetButtonDown("X_1") || Input.GetButtonDown("B_1") || Input.GetButtonDown("Y_1"))
     {
         ScreenEffectsManager.SwitchToScene("main_menu");
     }
 }
Пример #4
0
 // Use this for initialization
 private void Awake()
 {
     if (manager != null && manager != this)
     {
         DestroyImmediate(this.gameObject);
         return;
     }
     manager = this;
     material.SetFloat("_TimeBegin", -50000);
     material.SetFloat("_Selector", (float)Random.Range(0, 3));
     material.SetFloat("_Distorsion", (float)Random.Range(0, 2));
 }
Пример #5
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);

            _currentState.Draw();

            _spriteBatch.Begin(sortMode: SpriteSortMode.Deferred, blendState: BlendState.AlphaBlend);
            ScreenEffectsManager.Draw(_spriteBatch);
            UIHelper.Draw(_spriteBatch);
            _spriteBatch.End();

            base.Draw(gameTime);
        }
Пример #6
0
    void Update()
    {
        if (_isVisible)
        {
            // Manager players inputs
            if (LevelManager.Manager.type == LevelManager.Type.Normal)
            {
                if (Input.GetButtonDown("Back_1"))
                {
                    ScreenEffectsManager.SwitchToScene("main_menu");
                }

                if (Input.GetButtonDown("Start_1"))
                {
                    if (LevelManager.Manager.Score < scoreMedium)
                    {
                        ScreenEffectsManager.SwitchToScene(SceneManager.GetActiveScene().name);
                    }
                    else
                    {
                        Story.story.LaunchNext();
                    }

                    ScreenEffectsManager.SwitchToScene(SceneManager.GetActiveScene().name);
                }
            }
            else
            {
                if (Input.GetButtonDown("Back_1"))
                {
                    ScreenEffectsManager.SwitchToScene("main_menu");
                }

                if (Input.GetButtonDown("Start_1"))
                {
                    ScreenEffectsManager.manager.Launch();
                    AsyncOperation op = SceneManager.LoadSceneAsync("main");
                    op.allowSceneActivation              = false;
                    ScreenEffectsManager.manager.middle += () =>
                    {
                        LevelManager.Manager.type = LevelManager.Type.Random;
                        LevelManager.Manager.Init();
                        op.allowSceneActivation = true;
                    };
                }
            }
        }
    }
Пример #7
0
        protected override void Update(GameTime gameTime)
        {
            Window.Title = "Looking for Group";

            InputHelper.UpdateSetup();

            //if (Triggers.Quit.Pressed())
            //    Exit();

            var nextState = _currentState.Update(gameTime);

            switch (nextState)
            {
            case GameStateType.MainMenu:
            {
                _currentState = new MainMenuState(GraphicsDevice);
            }
            break;

            case GameStateType.InGame:
            {
                _currentState = new InGameState(GraphicsDevice);
            }
            break;

            case GameStateType.GameOver:
            {
                _currentState = new GameOverState(GraphicsDevice);
            }
            break;

            case GameStateType.PlayerWon:
            {
                _currentState = new PlayerWonState(GraphicsDevice);
            }
            break;

            case GameStateType.HowToPlay:
            {
                _currentState = new HowToPlayState(GraphicsDevice);
            }
            break;

            case GameStateType.Credits:
            {
                _currentState = new CreditsState(GraphicsDevice);
            }
            break;

            case GameStateType.Settings:
            {
                _currentState = new SettingState(GraphicsDevice);
            }
            break;
            }

            Assets.SoundManager.Update();
            ScreenEffectsManager.Update(gameTime);

            InputHelper.UpdateCleanup();
            base.Update(gameTime);
        }
Пример #8
0
 public void LaunchCredits()
 {
     AkSoundEngine.PostEvent("menu_back", gameObject);
     ScreenEffectsManager.SwitchToScene("credits");
 }
Пример #9
0
 public void QuitToMenu()
 {
     ScreenEffectsManager.SwitchToScene("main_menu");
     Story.story.next = 0;
 }