コード例 #1
0
    //---------------------------------------------------------------------------------------------

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

        else
        {
            _state = StateGame.Start;
        }
    }
コード例 #2
0
ファイル: Enemy.cs プロジェクト: ValerijShpagin/TestWork
    //---------------------------------------------------------------------------------------------

    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();
        }
    }