Esempio n. 1
0
 private void Update()
 {
     if (offensiveAbility != null && _canUseBasic && currentAbilityExample[1])
     {
         if (fireAbility(offensiveAbility, _canUseBasic))
         {
             _canUseBasic = false;
             offensiveAbility.AbilityInUse();
             StartCoroutine(OffensiveAbilityCooldown());
         }
     }
     else if (defensiveAbility != null && _canUseDefensiveAbility && currentAbilityExample[2])
     {
         if (fireAbility(defensiveAbility, _canUseDefensiveAbility))
         {
             _canUseDefensiveAbility = false;
             defensiveAbility.AbilityInUse();
             StartCoroutine(DefensiveAbilityCooldown());
             StartCoroutine(DefensiveAbilityDuration());
         }
     }
     else if (boostAbility != null && _canBoost && currentAbilityExample[3])
     {
         if (fireAbility(boostAbility, _canBoost))
         {
             _canBoost = false;
             boostAbility.AbilityInUse();
             StartCoroutine(BoostAbilityCooldown());
             StartCoroutine(BoostAbilityDuration());
         }
     }
 }
    // Update is called once per frame
    void Update()
    {
        if (_vehicleInput != null)
        {
            if (!_vehicleInput.getStatus())
            {
                return;
            }
        }
        getInput();

        // Basic Ability Call
        if (offensiveAbility != null && offensiveTrigger && abilitiesActivated)
        {
            if (fireAbility(offensiveAbility, _canUseBasic, offensiveFillBar, offensiveBrightIcon, offensiveAbilityBG, 'o'))
            {
                _canUseBasic = false;
                offensiveAbility.AbilityInUse();
                StartCoroutine(OffensiveAbilityCooldown());
            }
        }

        // Signature Ability Call
        if (defensiveAbility != null && defensiveTrigger && abilitiesActivated)
        {
            if (fireAbility(defensiveAbility, _canUseDefensiveAbility, defensiveAbilityFillAmount, defensiveBrightIcon, DefensiveAbilityBG, 'd'))
            {
                _canUseDefensiveAbility = false;
                defensiveAbility.AbilityInUse();
                StartCoroutine(DefensiveAbilityCooldown());
                StartCoroutine(DefensiveAbilityDuration());
            }
        }

        // Boost Ability Call
        if (boostAbility != null && boostTrigger && abilitiesActivated)
        {
            if (fireAbility(boostAbility, _canBoost, boostFillBar, boostBrightIcon, BoostAbilityBG, 'b'))
            {
                _canBoost = false;
                boostAbility.AbilityInUse();
                StartCoroutine(BoostAbilityCooldown());
                StartCoroutine(BoostAbilityDuration());
                rayCastCar.isBoosting = true;
                //    StartCoroutine(ChangeFOV());
                AudioManager.instance.Play("Boost", transform);
            }
        }
    }