private void CheckTeleportReset(AmplifyMotionEffectBase inst) { if (Vector3.SqrMagnitude(base.transform.position - this.m_lastPosition) > inst.MinResetDeltaDistSqr) { AmplifyMotionObjectBase.RecursiveResetMotionAtFrame(base.transform, this, Time.frameCount + inst.ResetFrameDelay); } }
private static void RecursiveResetMotionAtFrame(Transform transform, AmplifyMotionObjectBase obj, int frame) { if (obj != null) { obj.m_resetAtFrame = frame; } IEnumerator enumerator = transform.GetEnumerator(); try { while (enumerator.MoveNext()) { object obj2 = enumerator.Current; Transform transform2 = (Transform)obj2; AmplifyMotionObjectBase.RecursiveResetMotionAtFrame(transform2, transform2.GetComponent <AmplifyMotionObjectBase>(), frame); } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } }
private static void RecursiveResetMotionAtFrame(Transform transform, AmplifyMotionObjectBase obj, int frame) { if (obj != null) { obj.m_resetAtFrame = frame; } foreach (object obj2 in transform) { Transform transform2 = (Transform)obj2; AmplifyMotionObjectBase.RecursiveResetMotionAtFrame(transform2, transform2.GetComponent <AmplifyMotionObjectBase>(), frame); } }
public void ResetMotionAtFrame(int frame) { AmplifyMotionObjectBase.RecursiveResetMotionAtFrame(base.transform, this, frame); }
public void ResetMotionNow() { AmplifyMotionObjectBase.RecursiveResetMotionAtFrame(base.transform, this, Time.frameCount); }