Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        //Switch recharge target
        if (checkSwitchRechargeTarget())
        {
            rechargeTargetIndex++;
            rechargeTargetIndex = rechargeTargetIndex % resourceBars.Count;
            rechargeTarget      = resourceBars[rechargeTargetIndex];
        }
        //Recharge
        rechargeTarget.recharge(rechargeRate * Time.deltaTime);

        //Process Inputs
        checkMovement();
        if (ability1)
        {
            if (checkAbility(ability1, "Ability1"))
            {
                ability1.activate();
            }
        }
        if (ability2)
        {
            if (checkAbility(ability2, "Ability2"))
            {
                ability2.activate();
            }
        }
        if (ability3)
        {
            if (checkAbility(ability3, "Ability3"))
            {
                ability3.activate();
            }
        }

        //Close program
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Application.Quit();
        }
    }