void RemoveObject(FlagScript visionObject) { if (objectsFlagsInRange.Contains(visionObject)) { objectsFlagsInRange.Remove(visionObject); objectsInRange.Remove(visionObject.gameObject); objectsInRangeHealthScripts.Remove(visionObject.GetComponent <HealthScript>()); unitScript.unitGroupScript.removeUnitFromRange(visionObject.gameObject); } }
void AddObject(FlagScript visionObject) { if(visionObject != null) { if(!objectsFlagsInRange.Contains(visionObject)) { objectsFlagsInRange.Add(visionObject); objectsInRange.Add(visionObject.gameObject); objectsInRangeHealthScripts.Add (visionObject.GetComponent<HealthScript>()); unitScript.unitGroupScript.addUnitToRange(visionObject.gameObject); } } }
void AddObject(FlagScript visionObject) { if (visionObject != null) { if (!objectsFlagsInRange.Contains(visionObject)) { objectsFlagsInRange.Add(visionObject); objectsInRange.Add(visionObject.gameObject); objectsInRangeHealthScripts.Add(visionObject.GetComponent <HealthScript>()); unitScript.unitGroupScript.addUnitToRange(visionObject.gameObject); } } }
void RemoveObject(FlagScript visionObject) { if(objectsFlagsInRange.Contains(visionObject)) { objectsFlagsInRange.Remove(visionObject); objectsInRange.Remove(visionObject.gameObject); objectsInRangeHealthScripts.Remove (visionObject.GetComponent<HealthScript>()); unitScript.unitGroupScript.removeUnitFromRange(visionObject.gameObject); } }