chenxin
2020-11-05 d6161eec964b2eeb23bd93c84c29f8ffd3a2d06f
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
using Core.Utilities;
using UnityEngine;
 
/**
 * 泡泡炸弹
 * @Author: chenxin
 * @Date: 2020-11-03 17:26:27
 */
namespace TowerDefense.Agents
{
    public class BubbleBombAgent : Agent
    {
        /// <summary>
        /// 外部赋值,唯一标识一个泡泡炸弹代理
        /// </summary>
        public int Id { get; set; }
 
        /// <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()
        {
            NormalEffect.Play();
        }
 
        /// <summary>
        /// 停止正常状态的特效
        /// </summary>
        public void StopNormalEffect()
        {
            NormalEffect.Stop();
            NormalEffect.Clear();
        }
 
        /// <summary>
        /// 播放爆炸的特效
        /// </summary>
        public void PlayExplodeEffect()
        {
            ExplodeEffect.Play();
        }
 
        /// <summary>
        /// 停止爆炸特效
        /// </summary>
        public void StopExplodeEffect()
        {
            ExplodeEffect.Stop();
            ExplodeEffect.Clear();
        }
 
        /// <summary>
        /// 获取爆炸特效持续时间,该时间过后会回收gameObject
        /// </summary>
        public float GetExplodeTime()
        {
            return 1.15f;
        }
 
        protected override void Update()
        {
            
        }
    }
}