Beispiel #1
0
 //Function that handles speed reduction, whenever a player stops charging a shot or steps out a trap
 public void RaiseSpeed(SlowingType type)
 {
     switch (type)
     {
     case SlowingType.Charge:
         if (chargeReduce)
         {
             animator.SetFloat("Speed", animator.GetFloat("Speed") / swingType.animatorChargingDivider);
             currentSpeed /= swingType.chargingDivider;
             chargeReduce  = false;
         }
         break;
         // case SlowingType.Trap:
         //  if (trapReduce) {
         //      animator.SetFloat("Speed",animator.GetFloat("Speed") / playerType.animatorTrapDivider);
         //      currentSpeed *= playerType.trapDivider;
         //      trapReduce = false;
         //  }
         //	break;
     }
     if (currentSpeed < initialSpeedWithModifier)
     {
         currentSpeed = initialSpeedWithModifier;
     }
 }
Beispiel #2
0
 //Function that handles speed reduction, whenever a player is charging a shot or steps on a trap
 public void ReduceSpeed(SlowingType type)
 {
     switch (type)
     {
     case SlowingType.Charge:
         if (!chargeReduce)
         {
             StartCoroutine(ChargeSlowing(swingType.chargingDivider, swingType.animatorChargingDivider));
             chargeReduce = true;
         }
         break;
         // case SlowingType.Trap:
         //  if (!trapReduce) {
         //      animator.SetFloat("Speed",animator.GetFloat("Speed") * playerType.animatorTrapDivider);
         //      currentSpeed /= playerType.trapDivider;
         //      trapReduce = true;
         //  }
         //  break;
     }
     if (currentSpeed > initialSpeedWithModifier)
     {
         currentSpeed = initialSpeedWithModifier;
     }
 }