Exemple #1
0
 //Start Dash
 //@return Boolean value telling program whether mechanic worked or if Stamina cost or barrier on the map stopped it
 public override bool Activate()
 {
     base.Activate();
     velocity = userScript.GetMovement();
     if (velocity != Vector2.zero)
     {
         bool status = GameManager.instance.DrainStamina(STAMINA_COST);
         if (status)
         {
             dashing  = true;
             dashLeft = DASH_LENGTH;
             userScript.SetMobility(false);
             userScript.AnimateDash(velocity);
             return(true);
         }
     }
     //If one or both if statements fail, the code will reach this point and return false
     return(false);
 }