chenxin
2020-10-27 38136a34de9aa36bf15ec7471abd56e2cba6c26f
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
using Core.Health;
using TowerDefense.Towers;
using UnityEngine;
 
namespace TowerDefense.Affectors
{
    /// <summary>
    /// A class for providing information on to whether
    /// the children classes effects are valid
    /// </summary>
    public abstract class Affector : MonoBehaviour
    {
        /// <summary>
        /// Short description for affector for displaying in the UI
        /// </summary>
        public string description;
 
        /// <summary>
        /// Gets or sets the alignment
        /// </summary>
        public IAlignmentProvider alignment { get; protected set; }
 
        /// <summary>
        /// The physics mask to check against
        /// </summary>
        public LayerMask enemyMask { get; protected set; }
 
        /// <summary>
        /// 设置当前Affector对应的兵线ID.
        /// </summary>
        public int waveLineID { get; set; }
 
 
        /// <summary>
        /// 当前Affactor对应的Tower指针.
        /// </summary>
        public Tower towerPtr { get; set; }
 
        /// <summary>
        /// Initializes the effect with search data
        /// </summary>
        /// <param name="affectorAlignment">
        /// The alignment of the effect for search purposes
        /// </param>
        /// <param name="mask">
        /// The physics layer of to search for
        /// </param>
        public virtual void Initialize(IAlignmentProvider affectorAlignment, LayerMask mask)
        {
            alignment = affectorAlignment;
            enemyMask = mask;
        }
 
        /// <summary>
        /// 返回可能存在的Targetter.
        /// </summary>
        /// <returns></returns>
        public virtual TowerDefense.Targetting.Targetter GetTargetter()
        {
            return null;
        }
 
        /// <summary>
        /// Initializes the effect with search data
        /// </summary>
        /// <param name="affectorAlignment">
        /// The alignment of the effect for search purposes
        /// </param>
        public virtual void Initialize(IAlignmentProvider affectorAlignment)
        {
            Initialize(affectorAlignment, -1);
        }
    }
}