public void ExitScreen() { DeathScreenActive.Value = false; DeathScreenParent.gameObject.SetActive(false); OnPlayerRespawn.Invoke(); }
//死亡延迟复活 private IEnumerator WaitPlayerDead() { yield return(new WaitForSeconds(2f)); Instantiate(Player, Player.transform.position, Quaternion.identity); if (OnPlayerRespawn != null) { OnPlayerRespawn.Invoke(); } }
public void Respawn() { if (enabled) { return; } transform.position = new Vector3(0, 1, 0); OnPlayerRespawn?.Invoke(); DeathScreen.Instance.SetActive(false); GetComponent <HealthSystem>().Increase(20); hungerSytem.Increase(20); enabled = true; }
public void PlayerRespawned() { OnPlayerRespawn?.Invoke(); }
public void CallOnPlayerRespawnEvent() => OnPlayerRespawn?.Invoke();