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; }
public override void Entry() { motion?.SetSpeedX(0); }