chenxin
2020-12-01 e36f2a3ac098d6e89d3882f3354ec69c07e71e16
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
using DG.Tweening;
using UnityEngine;
 
/**
 * 泡泡炸弹
 * @Author: chenxin
 * @Date: 2020-11-03 17:26:27
 */
namespace TowerDefense.Agents
{
    public class BubbleBombAgent : Agent
    {
        /// <summary>
        /// 正常的特效
        /// </summary>
        public ParticleSystem NormalEffect;
 
        /// <summary>
        /// 爆炸的特效
        /// </summary>
        public ParticleSystem ExplodeEffect;
 
        /// <summary>
        /// Peforms the relevant path update
        /// 执行相关路径更新
        /// </summary>
        protected override void PathUpdate()
        {
 
        }
 
        /// <summary>
        /// The behaviour for when the agent has been blocked
        /// 代理被阻止时的行为
        /// </summary>
        protected override void OnPartialPathUpdate()
        {
 
        }
 
        /// <summary>
        /// 重置数据
        /// </summary>
        public void Reset()
        {
            CanMove = true;
            bInDeathState = false;
        }
 
        /// <summary>
        /// 播放正常状态的特效
        /// </summary>
        public void PlayNormalEffect()
        {
            if (NormalEffect != null)
                NormalEffect.Play();
        }
 
        /// <summary>
        /// 停止正常状态的特效
        /// </summary>
        public void StopNormalEffect()
        {
            if (NormalEffect != null)
                NormalEffect.Stop();
        }
 
        /// <summary>
        /// 播放爆炸的特效
        /// </summary>
        public void PlayExplodeEffect()
        {
            if (ExplodeEffect != null)
                ExplodeEffect.Play();
        }
 
        /// <summary>
        /// 停止爆炸特效
        /// </summary>
        public void StopExplodeEffect()
        {
            if (ExplodeEffect != null)
                ExplodeEffect.Stop();
        }
 
        /// <summary>
        /// 获取爆炸特效持续时间,该时间过后会回收gameObject
        /// </summary>
        public float GetExplodeTime()
        {
            return 1.15f;
        }
 
        protected override void Update()
        {
 
        }
 
        protected override void LateUpdate()
        {
 
        }
 
        public override void Initialize()
        {
            this.configuration.bInvincible = true;
            mDefaultScale = this.transform.localScale;
            Sequence agentTweenSeq = DOTween.Sequence();
            var ss = mDefaultScale * 0.3f;
            this.transform.localScale = this.transform.localScale * 0.3f;
            Tweener agScale = this.transform.DOScale(mDefaultScale, 0.3f);
            agentTweenSeq.Append(agScale);
            agentTweenSeq.AppendCallback(beDamageStart);
        }
 
        public override void PlayDeath()
        {
            Debug.LogError("---- BubbleBombAgent PlayDeath 正常逻辑不应该打印出这句话 ----");
        }
    }
}