public void DespawnPlayer(PlayerShipComponent player) { _multiplePrefabMemoryPool.DespawnObject(player.gameObject); _bookKeepingInGameData.PlayerShipComponent = null; _gameSignals.PlayerDespawnedSignal.Fire(player); }
private bool HandlePlayerDespawned(PlayerShipComponent player) { if (_bookKeepingInGameData.PlayerLife.Value > 0) { RespawnPlayerWithDelay(_asteroidGameSettings.respawnDelayInSeconds); } return(true); }
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); }
private bool HandlePlayerDespawned(PlayerShipComponent playerShipController) { RemoveTransform(playerShipController.transform); return(true); }
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(); }