yyl
2025-08-25 cec8b67d82c2c2c1662d55c818c4a46bcc0487db
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using UnityEngine;
using System.Collections;
 
    public class PositionTween : TweenEx
    {
 
        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();
        }
 
    }