using UnityEngine; using System.Collections; public class PositionTween : Tween { public override void SetStartState() { base.SetStartState(); this.rectTransform.anchoredPosition = from; } public override void SetEndState() { base.SetEndState(); this.rectTransform.anchoredPosition = to; } protected override void OnPrepare() { base.OnPrepare(); this.rectTransform.anchoredPosition = reversal ? to : from; } protected override void OnOnceEnd() { if (wrapMode == WrapMode.PingPongOnce) { SetStartState(); } else { this.rectTransform.anchoredPosition = reversal ? from : to; } base.OnOnceEnd(); } protected override void UpdateVector3() { base.UpdateVector3(); this.rectTransform.anchoredPosition = CalculateVector3(); } }