Esempio n. 1
0
    void Update()
    {
        inputStateManager.Update();

        // TODO (Roman): this must not make it into release
        //#if !FINAL

        if (Input.GetKeyUp("n"))
        {
            Debug.Log("Key Command: Go to next checkpoint");

            _currentCheckpointIndex--;
            if (_currentCheckpointIndex < 0)
            {
                _currentCheckpointIndex = _orderedSceneCheckpoints.Count - 1;
            }

            GameObject checkpoint = _orderedSceneCheckpoints[_currentCheckpointIndex].gameObject;
            this.player.spawnLocation = checkpoint.gameObject.transform.position;
            this.player.Respawn();
        }
        if (Input.GetKeyUp("p"))
        {
            Debug.Log("Key Command: Go to previous checkpoint");

            _currentCheckpointIndex++;
            if (_currentCheckpointIndex >= _orderedSceneCheckpoints.Count)
            {
                _currentCheckpointIndex = 0;
            }

            GameObject checkpoint = _orderedSceneCheckpoints[_currentCheckpointIndex].gameObject;
            this.player.spawnLocation = checkpoint.gameObject.transform.position;
            this.player.Respawn();
        }
        if (Input.GetKeyUp("z"))
        {
            Debug.Log("Key Command: add all powerups");

            GameManager.instance.powerUpManager.ApplyPowerUpItem(PowerUpType.Floater);
            GameManager.instance.powerUpManager.ApplyPowerUpItem(PowerUpType.DoubleJump);
            GameManager.instance.powerUpManager.ApplyPowerUpItem(PowerUpType.SpinMeleeAttack);
            GameManager.instance.powerUpManager.ApplyPowerUpItem(PowerUpType.JetPack);
            GameManager.instance.powerUpManager.ApplyPowerUpItem(PowerUpType.Gun);
        }


        //#endif

        if (Input.GetKey("escape"))
        {
            Logger.Info("quit");
            Application.Quit();
        }

        UpdateFPS();
    }
Esempio n. 2
0
    void Update()
    {
        InputStateManager.Update();

        // TODO (Roman): this must not make it into release
        if (Input.GetKey("escape"))
        {
            Logger.Info("quit");

            Application.Quit();
        }

#if !FINAL
        _fpsRenderer.UpdateFPS();
#endif
    }