Example #1
0
 private void FireRsEvent()
 {
     if (!restartText.IsActive())
     {
         EventSystem.current.SetSelectedGameObject(null, null);
         btn.enabled = false;
         RespawnEvent?.Invoke();
     }
 }
Example #2
0
 public void RpcKill()
 {
     if (photonView.IsMine)
     {
         AudioSource.PlayClipAtPoint(hitSound, transform.position);
         //id.owner.profile.deaths++;
         //id.owner.profile.CalculateKDR();
         RespawnEvent?.Invoke();
         PhotonNetwork.Destroy(gameObject);
     }
 }
Example #3
0
    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;
    }
Example #4
0
        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;
        }
Example #5
0
 /// <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);
 }