private void RequestBuff() { if (this.m_Owner == null) { return; } for (int index1 = 0; index1 < this.m_Owner.BuffAttachments.Count; ++index1) { BuffAttachment buffAttachment = this.m_Owner.BuffAttachments[index1]; if (!(bool)buffAttachment.IsPassive && this.GetObject(buffAttachment) == null) { foreach (UnitBuffDisplayNode.Param obj in UnitBuffDisplayNode.CreateParams(this, this.m_Owner, buffAttachment)) { UnitBuffDisplay.Object @object = (UnitBuffDisplay.Object)null; for (int index2 = 0; index2 < this.m_Objects.Count; ++index2) { if (this.m_Objects[index2].IsEqual(obj)) { @object = this.m_Objects[index2]; break; } } if (@object == null) { this.m_Objects.Add(new UnitBuffDisplay.Object(obj)); } else { @object.Add(obj); } } } } }
private void Release() { for (int index = 0; index < this.m_Objects.Count; ++index) { this.RemoveNode(this.m_Objects[index]); } this.m_Objects.Clear(); this.m_DispObjects.Clear(); this.m_CurrentObject = (UnitBuffDisplay.Object)null; this.m_Owner = (Unit)null; }
private void RemoveNode(UnitBuffDisplay.Object obj) { if (UnityEngine.Object.op_Inequality((UnityEngine.Object)obj.node, (UnityEngine.Object)null)) { UnityEngine.Object.Destroy((UnityEngine.Object)((Component)obj.node).get_gameObject()); obj.node = (UnitBuffDisplayNode)null; } if (this.m_CurrentObject != obj) { return; } this.m_CurrentObject = (UnitBuffDisplay.Object)null; }
private void CreateNode(UnitBuffDisplay.Object obj) { if (this.m_CurrentObject != null) { this.RemoveNode(this.m_CurrentObject); } GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)((Component)this.m_NodeRoot).get_gameObject()); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null)) { obj.node = (UnitBuffDisplayNode)gameObject.GetComponent <UnitBuffDisplayNode>(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)obj.node, (UnityEngine.Object)null)) { obj.node.Setup(obj.paramlist[0]); gameObject.get_transform().SetParent(this.m_Root.get_transform(), false); } gameObject.SetActive(true); } this.m_Time = 0.0f; this.m_CurrentObject = obj; }
private void UpdateBuff() { this.m_DispObjects.Clear(); for (int index1 = 0; index1 < this.m_Objects.Count; ++index1) { UnitBuffDisplay.Object @object = this.m_Objects[index1]; for (int index2 = 0; index2 < @object.paramlist.Count; ++index2) { if ([email protected][index2].isAlive) { @object.Remove(@object.paramlist[index2]); --index2; } } if (@object.paramlist.Count == 0) { this.RemoveNode(@object); this.m_Objects.Remove(@object); --index1; } else { bool flag = false; for (int index2 = 0; index2 < @object.paramlist.Count; ++index2) { if (@object.paramlist[index2].isNeedDispOn) { flag = true; break; } } if (flag) { this.m_DispObjects.Add(@object); } } } }