public void AddElement(GameObject obj, string tag, MiniMapSignal map, int group, Vector2 loc) { elementObj.Add(obj); elementMap.Add(map); elementTransform.Add(obj.transform); elementLoc.Add(loc); elementGroup.Add(group); objAmount++; }
public bool AddElement(GameObject obj, string tag, MiniMapSignal map, int group) { bool found = false; int index = 0; for(int x = 0; x < elements.Length; x++){ if(elements[x].tag == tag){ index = x; found = true; break; } } if(found){ elements[index].AddElement(obj, tag, map, group, Determine2dLoc(obj.transform.position)); return true; } else{ return false; } }
private void Awake() { selection = GameObject.Find("Player Manager").GetComponent <UnitSelection>(); vision = gameObject.GetComponent <VisionSignal>(); miniMap = gameObject.GetComponent <MiniMapSignal>(); movement = gameObject.GetComponent <UnitMovement>(); gui.type = "Unit"; gui.Awake(gameObject); for (int x = 0; x < techEffect.Length; x++) { var technology = Faction.Tech[techEffect[x].index]; technology.AddListener(gameObject); if (technology.active) { Upgraded(technology.name); } } gameObject.name = name; healthObj = GetComponent <Health>(); }
public bool AddElement(GameObject obj, string tag, MiniMapSignal map, int group) { bool found = false; int index = 0; for (int x = 0; x < elements.Length; x++) { if (elements[x].tag == tag) { index = x; found = true; break; } } if (found) { elements[index].AddElement(obj, tag, map, group, Determine2dLoc(obj.transform.position)); return(true); } else { return(false); } }
void Start() { selection = GameObject.Find("Player Manager").GetComponent<UnitSelection>(); vision = gameObject.GetComponent<VisionSignal>(); miniMap = gameObject.GetComponent<MiniMapSignal>(); gui.type = "Unit"; mGroup = GameObject.Find("Faction Manager").GetComponent<GroupManager>().groupList[group].GetComponent<Group>(); gui.Start(gameObject); for(int x = 0; x < techEffect.Length; x++){ mGroup.tech[techEffect[x].index].AddListener(gameObject); if(mGroup.tech[techEffect[x].index].active){ Upgraded(mGroup.tech[techEffect[x].index].name); } } gameObject.name = name; healthObj = GetComponent<Health>(); }