Beispiel #1
0
 void LateUpdate()
 {
     if (Mathf.Approximately(physic.GetVelocity().y, 0))
     {
         Desactivate();
     }
     else if (spin && ZRotationStep.z > 0)
     {
         transform.Rotate(ZRotationStep);
         ZRotationStep.z = Mathf.MoveTowards(ZRotationStep.z, 0, ZRotationFactorInitial * Time.deltaTime / 1.5f);
     }
 }
Beispiel #2
0
 public bool IsInMotion()
 {
     return(physics.GetVelocity() != Vector2.zero);
 }