예제 #1
0
    //---------------------------------------------------------------------------------------------

    private void CheckStatusGame()
    {
        if (!_player)
        {
            _state = StateGame.GameOver;
            _spawnerEnemy.DestroyObjects();
            _canvasGameOver.gameObject.SetActive(true);
        }

        else
        {
            _state = StateGame.Start;
        }
    }
예제 #2
0
    //---------------------------------------------------------------------------------------------

    private void Update()
    {
        // Check distance for destroy gameObjects
        if (Vector2.Distance(new Vector2(transform.position.x, transform.position.y),
                             new Vector2(transform.position.x, _borderMin)) < 0.01f)
        {
            _spawnerEnemy.DestroyObjects();
            _spawnerEnemy.SpawnObjects();
        }

        else
        {
            Move();
        }
    }