コード例 #1
0
    public void ExitScreen()
    {
        DeathScreenActive.Value = false;
        DeathScreenParent.gameObject.SetActive(false);

        OnPlayerRespawn.Invoke();
    }
コード例 #2
0
    //死亡延迟复活
    private IEnumerator WaitPlayerDead()
    {
        yield return(new WaitForSeconds(2f));

        Instantiate(Player, Player.transform.position, Quaternion.identity);


        if (OnPlayerRespawn != null)
        {
            OnPlayerRespawn.Invoke();
        }
    }
コード例 #3
0
 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;
 }
コード例 #4
0
 public void PlayerRespawned()
 {
     OnPlayerRespawn?.Invoke();
 }
コード例 #5
0
 public void CallOnPlayerRespawnEvent() =>
 OnPlayerRespawn?.Invoke();