private void FireRsEvent() { if (!restartText.IsActive()) { EventSystem.current.SetSelectedGameObject(null, null); btn.enabled = false; RespawnEvent?.Invoke(); } }
public void RpcKill() { if (photonView.IsMine) { AudioSource.PlayClipAtPoint(hitSound, transform.position); //id.owner.profile.deaths++; //id.owner.profile.CalculateKDR(); RespawnEvent?.Invoke(); PhotonNetwork.Destroy(gameObject); } }
public IEnumerator DeathTransition() { DeathEvent?.Invoke(); // Debug.Log("Start"); yield return(new WaitForSeconds(PlayerManager._instance.GetPlayerGFX.GetDeathAnimLength)); // Debug.Log("Player Died"); UIManager._instance.BlackPanel(true); yield return(new WaitForSeconds(extraDelay)); UIManager._instance.BlackPanel(false); RespawnEvent?.Invoke(); startedDeathEvent = false; }
private void PlayerUpdate(Player player, int i) { TSPlayer ply = new TSPlayer(i); if (ply.UUID == "") { return; } if (player.dead && !prevDeadState[i]) { // Died DeathEvent.Invoke(ply); } if (!player.dead && prevDeadState[i]) { // Respawned RespawnEvent.Invoke(ply); } prevDeadState[i] = player.dead; }
/// <summary> /// Respawn the object. /// </summary> /// <param name="resetHealth">Should the characters health be reset.</param> public void RespawnTarget(bool resetHealth = true) { m_RespawnEvent.Invoke(resetHealth); }