private void OnTriggerExit2D(Collider2D collision) { if (collision.gameObject.CompareTag("BattleGroup")) { BattleGroupController tempBg = collision.gameObject.GetComponent <BattleGroupController>(); if (touchingBattleGroups.Contains(tempBg)) { touchingBattleGroups.Remove(tempBg); } } }
public void SpawnBattleGroup() { if (stationType == StationType.HomeBase) { GameObject tempBG = Instantiate(battleGroupPrefab, transform.position, Quaternion.Euler(Vector3.zero)); BattleGroupController tempBGC = tempBG.GetComponent <BattleGroupController>(); tempBGC.Initialize(this, team, battleGroupsSpawned); battleGroupsSpawned++; battleGroups.Add(tempBGC); } }
public void Initialize(BattleGroupController bg) { BGController = bg; img.color = bg.GetColor(); nameTxt.text = "BG\n" + bg.tagNumber; }