public static LerpCoroutine <Vector3> SetLocalScale(this Transform self, Vector3 scale, float duration) { LerpCoroutine <Vector3> coroutine = new LerpCoroutine <Vector3>(duration, new Vector3Range(self.localScale, scale), (l) => { if (self) { self.localScale = l; } } ); coroutine.Start(); return(coroutine); }
public static LerpCoroutine <Vector3> SetPosition(this Transform self, Vector3 position, float duration) { LerpCoroutine <Vector3> coroutine = new LerpCoroutine <Vector3>(duration, new Vector3Range(self.position, position), (l) => { if (self) { self.position = l; } } ); coroutine.Start(); return(coroutine); }