public void DespawnPlayer(PlayerShipComponent player)
        {
            _multiplePrefabMemoryPool.DespawnObject(player.gameObject);

            _bookKeepingInGameData.PlayerShipComponent = null;
            _gameSignals.PlayerDespawnedSignal.Fire(player);
        }
Exemple #2
0
 private bool HandlePlayerDespawned(PlayerShipComponent player)
 {
     if (_bookKeepingInGameData.PlayerLife.Value > 0)
     {
         RespawnPlayerWithDelay(_asteroidGameSettings.respawnDelayInSeconds);
     }
     return(true);
 }
Exemple #3
0
 private bool HandlePlayerDespawned(PlayerShipComponent player)
 {
     if (_bookKeepingInGameData.PlayerLife.Value > 0)
     {
         _bookKeepingInGameData.PlayerLife.Value--;
     }
     return(true);
 }
        public async UniTask SpawnPlayer(PlayerShipComponent playerPrefab)
        {
            GameObject go = await _multiplePrefabMemoryPool.SpawnObject(playerPrefab.gameObject);

            go.transform.position = Vector3.zero;

            _bookKeepingInGameData.PlayerShipComponent = go.GetComponent <PlayerShipComponent>();
            _bookKeepingInGameData.PlayerShipComponent.Init();

            _gameSignals.PlayerSpawnedSignal.Fire(_bookKeepingInGameData.PlayerShipComponent);
        }
Exemple #5
0
 private bool HandlePlayerDespawned(PlayerShipComponent playerShipController)
 {
     RemoveTransform(playerShipController.transform);
     return(true);
 }
Exemple #6
0
 private void HandlePlayerSpawned(PlayerShipComponent playerShipController)
 {
     RegisterTransform(playerShipController.transform);
 }
 private void HandlePlayerSpawned(PlayerShipComponent playerShipComponent)
 {
     YieldReturn(true);
 }
 private bool HandlePlayerDespawned(PlayerShipComponent playerShipComponent)
 {
     YieldReturn(true);
     return(true);
 }
 protected virtual bool HandlePlayerDespawned(PlayerShipComponent playerShipController)
 {
     UnlistenForPlayerInput();
     return(true);
 }
 protected virtual void HandlePlayerSpawned(PlayerShipComponent playerShipController)
 {
     ListenForPlayerInput();
 }