コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (_enemy == null)
        {
            _enemy = Instantiate(_enemyPrefab) as GameObject;
            _enemy.transform.position = SpawnLocation();

            _enemy.transform.Rotate(0, Random.rotation.eulerAngles.y, 0);
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            switch (Paused)
            {
            case false:
                Time.timeScale = 0;
                MouseView.PressedPause(Paused);
                Paused = true;
                break;

            case true:
                Time.timeScale = 1;
                MouseView.PressedPause(Paused);
                Paused = false;
                break;
            }
        }
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        //Pause game
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            switch (Paused)
            {
            case false:
                Time.timeScale = 0;
                MouseView.PressedPause(Paused);
                Paused = true;
                break;

            case true:
                Time.timeScale = 1;
                MouseView.PressedPause(Paused);
                Paused = false;
                break;
            }

            ui.OnPaused(Paused);
        }
    }