// Use this for initialization void Start() { GameWorldManager = FindObjectOfType <WorldManager>(); GameMapManager = FindObjectOfType <MapManager>(); GamePlayerCountryManager = GameMapManager.GamePlayerCountryManager; GameBattleManager = FindObjectOfType <BattleManager>(); GameCharacterManager = FindObjectOfType <CharacterManager>(); GameDeckManager = FindObjectOfType <DeckManager>(); GameIntelManager = FindObjectOfType <IntelManager>(); GameMilitaryManager = FindObjectOfType <MilitaryManager>(); GameResearchManager = FindObjectOfType <ResearchManager>(); GameTradeManager = FindObjectOfType <TradeManager>(); GameUnitManager = FindObjectOfType <UnitManager>(); //DontDestroyOnLoad(transform.gameObject); }
void OnTriggerEnter2D(Collider2D other) { IntelManager intelSource = other.GetComponent <IntelManager>(); if (intelSource != null) { if (intelSource.intelCount > 0) { score(intelSource.intelCount); //TODO: light new objectives _returnsLeft--; intelSource.DropIntel(); } } other.GetComponent <PlayerHealth>().Health = 100; Debug.Log(other.GetComponent <PlayerHealth>().Health); GameObject[] allEnemies = GameObject.FindGameObjectsWithTag("Enemy"); for (int i = 0; i < allEnemies.Length; i++) { Destroy(allEnemies[i]); } }