//set a parent platform and node to this tower when it's build on a walkable platform public void SetPlatform(Platform platform, Node node) { occupiedPlatform=new OccupiedPlatform(platform, node); }
//call when the tower is sold or destroy public void Destroy() { if(onDestroyE!=null) onDestroyE(this); //tells platform to reactivate node if platform is walkable if(occupiedPlatform!=null){ //Debug.Log("clear attached platform"); occupiedPlatform.platform.UnBuild(occupiedPlatform.node); occupiedPlatform=null; } //else Debug.Log("no platform attached"); //tells gamecontrol to refund the tower //thisObj.SetActiveRecursively(false); Destroy(thisObj); }