summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Avatar/HitInfo.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-11-02 19:53:12 +0800
committerchai <chaifix@163.com>2020-11-02 19:53:12 +0800
commit3708d0a07ce43c3d98a0171eacfa9c370c873f96 (patch)
tree728f72bd8e6c464c6f56db7b08755031f685c45c /Assets/Scripts/Avatar/HitInfo.cs
parent64061aee5d7849f348f07b78fc3f96ad7555c147 (diff)
*受击
Diffstat (limited to 'Assets/Scripts/Avatar/HitInfo.cs')
-rw-r--r--Assets/Scripts/Avatar/HitInfo.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/Assets/Scripts/Avatar/HitInfo.cs b/Assets/Scripts/Avatar/HitInfo.cs
index bdb116eb..8d24f6ee 100644
--- a/Assets/Scripts/Avatar/HitInfo.cs
+++ b/Assets/Scripts/Avatar/HitInfo.cs
@@ -9,11 +9,11 @@ public class HitInfo
/// <summary>
/// 记录这个hit命中的avatar
/// </summary>
- private List<Avatar> m_HitAvatars;
+ private List<Avatar> m_HitAvatars = new List<Avatar>();
public void AddRecord(Avatar avatar)
{
- if (m_HitAvatars.Contains(avatar))
+ if (!m_HitAvatars.Contains(avatar))
m_HitAvatars.Add(avatar);
}
@@ -22,4 +22,10 @@ public class HitInfo
{
m_HitAvatars.Clear();
}
+
+ public bool HasRecord(Avatar avatar)
+ {
+ return m_HitAvatars.Contains(avatar);
+ }
+
}