Ejemplo n.º 1
0
    // The respawn timer
    IEnumerator RespawnTimer(PlayerChampion playerChampion)
    {
        GameUIHandler.Instance.deathBar.SetActive(true);
        float timeLeft       = 6;
        float reductionSpeed = 0.1f;

        // While the player is still dead, update the death countdown timer
        while (timeLeft > 0)
        {
            timeLeft -= reductionSpeed;
            int timeLeftInt = (int)Mathf.Ceil(timeLeft);
            if (timeLeftInt > 0)
            {
                GameUIHandler.Instance.deathBarText.text = "Respawning in " + timeLeftInt + " seconds";
                if (timeLeftInt == 1)
                {
                    GameUIHandler.Instance.deathBarText.text = "Respawning in " + timeLeftInt + " second";
                }
            }
            yield return(new WaitForSeconds(reductionSpeed));
        }

        // Once the death timer has ended, respawn the player on the network
        playerChampion.PhotonView.RPC("Heal", PhotonTargets.All, playerChampion.Champion.maxHealth);
        playerChampion.PhotonView.RPC("GiveMana", PhotonTargets.All, playerChampion.Champion.maxMana);
        Camera.main.GetComponent <UnityStandardAssets.ImageEffects.ColorCorrectionCurves>().saturation = 1;
        playerChampion.Respawn();
        GameUIHandler.Instance.deathBar.SetActive(false);
    }
Ejemplo n.º 2
0
    // Channel UI & Handler
    IEnumerator Channel()
    {
        recallTimeRemaining = ability.duration;
        while (recallTimeRemaining > 0.1f)
        {
            yield return(new WaitForSeconds(0.1f));

            recallTimeRemaining -= 0.1f;
            abilityHandler.recallFill.fillAmount = (recallTimeRemaining / ability.duration);
            abilityHandler.recallText.text       = recallTimeRemaining.ToString("F1");
            abilityHandler.recallContainer.SetActive(true);
        }
        playerChampion.Respawn();
        StopChannel();
    }