void Start() { nano_builder = resourceGrid.Hero.GetComponent<NanoBuilding_Handler> (); if (buildingCanvas == null) { Debug.Log("CLICK HANDLER: Building Canvas not set!"); } if (buildingPanel == null) { Debug.Log("CLICK HANDLER: Building Panel not set!"); } if (buildingStatusIndicator == null) { Debug.Log("CLICK HANDLER: Building Status Indicator not set!"); } if (buildingCanvas != null) { buildingCanvas.worldCamera = Camera.main; } // IF THIS BUILDING is spawned by the UI Handler, it won't need to make this search if (buildingUIhandler == null) { buildingUIhandler = GameObject.FindGameObjectWithTag ("UI").GetComponent<Building_UIHandler> (); } myCollider = GetComponent<BoxCollider2D> (); vertExtents = myCollider.bounds.extents.y; // get my tiletype myTileType = CheckTileType ((int)transform.position.x,(int) transform.position.y); }
void Start() { // get my tiletype //Debug.Log("CLICK HANDLER: pos = " + transform.position); myTileType = resourceGrid.TileFromWorldPoint(transform.position).tileType; // Register as Built for the Enemy Master to know resourceGrid.AddTowerBuiltForEnemyMaster(transform); if (myTileType != TileData.Types.capital) nano_builder = resourceGrid.Hero.GetComponent<NanoBuilding_Handler>(); if (buildingCanvas == null) { Debug.Log("CLICK HANDLER: Building Canvas not set!"); } if (buildingPanel == null) { Debug.Log("CLICK HANDLER: Building Panel not set!"); } if (buildingStatusIndicator == null) { Debug.Log("CLICK HANDLER: Building Status Indicator not set!"); } if (buildingCanvas != null) { buildingCanvas.worldCamera = Camera.main; } vertExtents = GetComponent<SpriteRenderer>().sprite.bounds.size.y; //if (resourceGrid.worldGridInitialized) //{ // myTile = resourceGrid.TileFromWorldPoint(transform.position); //} }