示例#1
0
 //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);
 }
示例#2
0
    //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);
    }