public void Dash(CustomDash dash) { if (dash_routine != null) { EndDash(); } dash_routine = StartCoroutine(CustomDashRoutine(dash)); }
IEnumerator CustomDashRoutine(CustomDash dash) { is_dashing = true; float timer = dash.length; Vector2 dash_start = transform.position; while (is_dashing && timer > 0 && !crowd_control_effects.IsCCed(CrowdControl.Type.stunned)) { float time_step = Mathf.Min(GameManager.GetFixedDeltaTime(team), timer); timer -= time_step; dash_force += dash.GetNext(dash.length - timer); yield return(new WaitForFixedUpdate()); } EndDash(); }