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); } }
public bool IsInMotion() { return(physics.GetVelocity() != Vector2.zero); }