| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | public class PositionTween : TweenEx |
| | | public class PositionTween : TweenEx |
| | | { |
| | | |
| | | public override void SetStartState() |
| | | { |
| | | base.SetStartState(); |
| | | this.rectTransform.anchoredPosition = from; |
| | | } |
| | | |
| | | public override void SetStartState() |
| | | 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) |
| | | { |
| | | base.SetStartState(); |
| | | this.rectTransform.anchoredPosition = from; |
| | | SetStartState(); |
| | | } |
| | | |
| | | public override void SetEndState() |
| | | { |
| | | base.SetEndState(); |
| | | this.rectTransform.anchoredPosition = to; |
| | | else |
| | | { |
| | | this.rectTransform.anchoredPosition = reversal ? from : to; |
| | | } |
| | | base.OnOnceEnd(); |
| | | |
| | | 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; |
| | | } |
| | | protected override void UpdateVector3() |
| | | { |
| | | base.UpdateVector3(); |
| | | this.rectTransform.anchoredPosition = CalculateVector3(); |
| | | } |
| | | |
| | | base.OnOnceEnd(); |
| | | } |
| | | |
| | | protected override void UpdateVector3() |
| | | { |
| | | base.UpdateVector3(); |
| | | this.rectTransform.anchoredPosition = CalculateVector3(); |
| | | } |
| | | |
| | | } |
| | | } |