private IEnumerator MovingTransform(Transform _parent, Vector3 _localPos, Quaternion _localRot, Vector3 _originScale, float _duration, System.Action _callBack) { MyUtility.CoroutineDelay delay = new MyUtility.CoroutineDelay(_duration); Vector3 startPos = m_tm_ObjectPivot.localPosition; Vector3 endPos = _localPos; Quaternion startRot = m_tm_ObjectPivot.localRotation; Quaternion endRot = _localRot; Vector3 startScale = m_tm_ObjectPivot.localScale; Vector3 endScale = MyUtility.GetParentScales(_parent, _originScale); delay.Reset(); while (!delay.IsEnd) { m_tm_ObjectPivot.localPosition = Vector3.Lerp(startPos, endPos, delay.NormalizedTime); m_tm_ObjectPivot.localRotation = Quaternion.Slerp(startRot, endRot, delay.NormalizedTime); m_tm_ObjectPivot.localScale = Vector3.Lerp(startScale, endScale, delay.NormalizedTime); yield return(null); } //Vector3 dir = endPos - startPos; //Vector3 xEndPos = startPos + Vector3.right * dir.x; //delay.Reset(); //while (!delay.IsEnd) //{ // m_tm_ObjectPivot.localPosition = Vector3.Lerp(startPos, xEndPos, delay.NormalizedTime); // yield return null; //} //delay.Reset(); //Vector3 yEndPos = xEndPos + Vector3.up * dir.y; //while (!delay.IsEnd) //{ // m_tm_ObjectPivot.localPosition = Vector3.Lerp(xEndPos, yEndPos, delay.NormalizedTime); // yield return null; //} //delay.Reset(); //Vector3 zEndPos = yEndPos + Vector3.forward * dir.z; //while (!delay.IsEnd) //{ // m_tm_ObjectPivot.localPosition = Vector3.Lerp(yEndPos, zEndPos, delay.NormalizedTime); // yield return null; //} yield return(null); _callBack?.Invoke(); m_ProcessingCoroutine = null; }