private void OnTriggerExit2D(Collider2D coll) { PlanetAgent pl = coll.gameObject.GetComponent <PlanetAgent>(); if (pl != null) { abortConquering(); this.planetAgent = null; this.planetInfoHide.hideGui(); } }
private void OnTriggerEnter2D(Collider2D coll) { if (coll.gameObject.GetComponent <SpacecraftColliderCheck>()) { return; } Planet planet = coll.gameObject.GetComponent <Planet>(); if (planet != null) { collectResources(planet); this.currentPlanet = planet; } this.planetAgent = coll.gameObject.GetComponent <PlanetAgent>(); if (this.planetAgent != null) { this.infoText.setGuiText(planet.planetResource.count, planet.name); collectResources(planet); this.planetInfoHide.showGui(); } }