示例#1
0
    void Update()
    {
        timer  += Time.deltaTime;
        cHealth = playerHealth.RetrieveCurrentHP();

        if (timer >= cooldown)
        {
            abilityImage.color = ready;
        }

        if (Input.GetButton(klik) && timer >= cooldown)
        {
            Activate();
        }

        if (active == true && timer >= duration)
        {
            active             = false;
            timer              = 0f;
            abilityImage.color = used;
            playerEnergy.SetOverload(0);
        }
    }