Example #1
0
 public override void LogicUpdate()
 {
     if (currentTime < time)
     {
         motion.SetSpeedX(currentSpeed);
     }
     else if (currentTime < time + wait)
     {
         motion.SetSpeedX(0);
     }
     else
     {
         currentTime   = 0;
         currentSpeed *= -1;
         motion.SetSpeedX(2 * currentSpeed);
     }
     currentTime += Time.deltaTime;
 }
Example #2
0
 public override void Entry()
 {
     motion?.SetSpeedX(0);
 }