wangguan
2020-12-26 b1f72b6a7f2c3846eacf26721e114e05ffe3a3db
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 UnityEngine;
 
namespace Core.Health
{
    /// <summary>
    /// Health change info - stores information about the health change
    /// </summary>
    public struct HealthChangeInfo
    {
        public Damageable damageable;
 
        public float oldHealth;
 
        public float newHealth;
 
        /// <summary>
        /// 是否存在魔法护盾
        /// </summary>
        public bool IsExistShieldWall { get; set; }
 
        /// <summary>
        /// 魔法护盾最大生命值
        /// </summary>
        public float ShieldWallMaxHealth;
 
        /// <summary>
        /// 魔法护盾当前生命值
        /// </summary>
        public float ShieldWallCurrentHealth;
 
        /// <summary>
        /// 上一次的魔法护盾生命值
        /// </summary>
        public float ShieldWallOldHealth;
 
        /// <summary>
        /// 用于标注是由哪个种类的Tower造成的伤害.
        /// </summary>
        public int attributeId;
 
        public IAlignmentProvider damageAlignment;
 
        public float healthDifference
        {
            get { return newHealth - oldHealth; }
        }
 
        public float absHealthDifference
        {
            get { return Mathf.Abs(healthDifference); }
        }
 
        public float ShieldWallHealthDifference
        {
            get { return ShieldWallCurrentHealth - ShieldWallOldHealth; }
        }
 
        public float AbsShieldWallHealthDifference
        {
            get { return Mathf.Abs(ShieldWallHealthDifference); }
        }
    }
}