IEnumerator Rotation() { var from = transform.localRotation * Quaternion.Euler(fromRotation); var to = transform.localRotation * Quaternion.Euler(toRotation); if (moveType == MoveType.Loop) { while (true) { transform.localRotation = MoverCommon.Loop(duration, from, to, offset); yield return(0); } } else { while (true) { transform.localRotation = MoverCommon.Wave(duration, from, to, offset); yield return(0); } } }
IEnumerator Scale() { var from = fromScale; var to = toScale; if (moveType == MoveType.Loop) { while (true) { transform.localScale = MoverCommon.Loop(duration, from, to, offset); yield return(0); } } else { while (true) { transform.localScale = MoverCommon.Wave(duration, from, to, offset); yield return(0); } } }
IEnumerator Position() { var from = transform.localPosition + fromPosition; var to = transform.localPosition + toPosition; if (moveType == MoveType.Loop) { while (true) { transform.localPosition = MoverCommon.Loop(duration, from, to, offset); yield return(0); } } else { while (true) { transform.localPosition = MoverCommon.Wave(duration, from, to, offset); yield return(0); } } }