public void CharacterDeath(int characterId) { _paused = true; if (characterId == 1) { LeftCharInfo.CharacterDeath(); StartCoroutine(ResetCharactersRoutine()); } else { RightCharInfo.CharacterDeath(); StartCoroutine(ResetCharactersRoutine()); } }
private void FixedUpdate() { if (!_paused) { LeftCharInfo.Move(RightCharInfo, _moveSpeed, _walkForwardForce); RightCharInfo.Move(LeftCharInfo, _moveSpeed, _walkForwardForce); if (LeftCharInfo.Go.transform.position.y < -60f) { PlayerDeathEvent.Raise(1); CharacterDeath(1); } else if (RightCharInfo.Go.transform.position.y < -60f) { PlayerDeathEvent.Raise(2); CharacterDeath(2); } } }
public void ResetCharacters() { LeftCharInfo.CharacterRevive(LeftCurrentSpawnPoint); RightCharInfo.CharacterRevive(RightCurrentSpawnPoint); }