Exemple #1
0
        private IEnumerator SpawnPlayer()
        {
            _respawning = true;
            yield return(new WaitForSeconds(_waitToRespawn));

            _playerObject.transform.position = _playerSpawner.transform.position;
            _playerObject.transform.rotation = _playerSpawner.transform.rotation;
            _playerObject.SetActive(true);
            _player.BecomeInvincible();
            _respawning = false;
        }
Exemple #2
0
        private PlayerSpaceShip SpawnPlayer()
        {
            PlayerSpaceShip playerShip   = null;
            GameObject      playerObject = playerSpawner.Spawn();

            if (playerObject != null)
            {
                playerShip = playerObject.GetComponent <PlayerSpaceShip>();
            }

            playerShip.BecomeInvincible();

            this.playerShip = playerShip;

            return(playerShip);
        }