summaryrefslogtreecommitdiff
path: root/Assets/UI_Extension/Scripts/Animation/Tween/TweenAnimation.cs
blob: 8494bef6b9276dba4b51beed0bbeebb6a835a733 (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

namespace TweenAnimation
{

    public class TweenAnimation : MonoBehaviour
    {
        public enum EventTriggeredDirection
        {
            None = 0, 
            Forward = 1, 
            Backward = 2,
        }

        public enum PlaybackStyle
        {
            Once, 
            Loop, 
            PingPong,
        }

        public string description = "No Description";

        public List<TweenModule> modules;

        public float duration;

        public PlaybackStyle playbackStyle;

        public EventTriggeredDirection eventTriggeredDirection;

        // 回放次数,0是不限制,默认是0
        public int playbackLimit;

        public TweenAnimation()
        {
            this.playbackStyle = PlaybackStyle.Loop;
            this.playbackLimit = 0;
            this.duration = 1;
            this.modules = new List<TweenModule>();
        }

        public void AddModule(TweenModule module)
        {
            if (modules == null)
                modules = new List<TweenModule>();
            modules.Add(module);
        }

        public void RemoveModule(TweenModule module)
        {
            if (modules == null)
                return;
            if (modules.Contains(module))
                modules.Remove(module);
        }

    }

}