void OnTriggerExit(Collider other) { if ((other.gameObject.tag == "EnemyEnergyPulse") && (other.gameObject.tag == "AllyEnergyPulse")) { energyPulse_Script energyPulse = other.gameObject.GetComponent <energyPulse_Script>(); energyPulse.setDontCollid(false); } }
void createPulse() { if (unitOwner == 1) { GameObject energyPulseGO = Instantiate(allyEnergyPulsePrefab, gameObject.transform); energyPulse_Script energyPulseGoScript = energyPulseGO.GetComponent <energyPulse_Script>(); energyPulseGoScript.setTarget(targetCurrent); energyPulseGoScript.setOwner(unitOwner); } if (unitOwner == -1) { GameObject energyPulseGO = Instantiate(enemyEnergyPulsePrefab, gameObject.transform); energyPulse_Script energyPulseGoScript = energyPulseGO.GetComponent <energyPulse_Script>(); energyPulseGoScript.setTarget(targetCurrent); energyPulseGoScript.setOwner(unitOwner); } }