public void AddStatusGroup(StatusGroup sg) { if (statusGroups.ContainsKey(sg.GetHashCode())) { statusGroups[sg.GetHashCode()].MergeStatus(sg); } else { statusGroups.Add(sg.GetHashCode(), sg); BattleManager bm = GameObject.FindGameObjectWithTag(Constants.BM.Tag).GetComponent <BattleManager>(); if (sg.showIcon) { bm.AddStatusIconToUI(); } Debug.Log($"Entity {this.name} added {sg.ToString()}, has {statusGroups.Count} statuses."); } }
public void RemoveStatusGroup(StatusGroup sg) { Debug.Log($"Entity {this.name} removes {sg.ToString()}, has {statusGroups.Count} statuses."); statusGroups.Remove(sg.GetHashCode()); }