Esempio n. 1
0
 private void FixedUpdate()
 {
     if (IsDashing && (DashCooldown <= 0))
     {
         if (dashTime <= 0)
         {
             IsDashing = false;
             lockable.UnlockMovement();
             DashCooldown = startDashCooldown;
         }
         else
         {
             dashTime      -= Time.deltaTime;
             rb2d.velocity *= dashSpeed;
         }
     }
     if (DashCooldown > 0)
     {
         DashCooldown -= Time.deltaTime;
     }
 }