bool CheckCollider(Collider colliderHit) { // We will just check if the collider has the tag "TowerHolder" // and then check if we can actually spawn there. // Early exit check if (!colliderHit) { return(false); } if (colliderHit.tag == "TowerHolder") { // Keep a copy of the transform. towerHolder = colliderHit.gameObject; // The line pretty much explains everything. HolderUtilities huInstance = colliderHit.gameObject.GetComponent <HolderUtilities> (); return(!huInstance.holds); } return(false); }
void GiveRemoveCommand() { HolderUtilities huInstance = towerHolder.GetComponent <HolderUtilities> (); huInstance.RemoveTower(); }
void GiveSpawnCommand() { HolderUtilities huInstance = towerHolder.GetComponent <HolderUtilities> (); huInstance.HoldTower(selectedTower); }