Пример #1
0
 private void StartCharge()
 {
     Time.timeScale = 1f;
     rb.velocity    = Vector3Extension.CalculateDirectionTowardsMouse(transform.position) * chargeSpeed;
     StartCoroutine("ChargeDuration", abilityDuration);
     anim.SetBool("Charge", true);
     isCharging = true;
     ArenaEvents.PlayerCharge();
     hasCharged = false;
 }
Пример #2
0
    IEnumerator ChargeDuration(float time)
    {
        yield return(new WaitForSeconds(time));

        GetComponent <PlayerHP>().canBeHurt = true;
        anim.SetBool("Charge", false);
        isCharging = false;
        ArenaEvents.PlayerCharge();
        rb.velocity = Vector2.zero;
        GetComponent <ArenaMovement>().enabled      = true;
        GetComponent <PlayerAttack>().enabled       = true;
        GetComponent <DivingElbowAbility>().enabled = true;
        StartCoroutine("AbilityCooldown", abilityCooldown);
    }