public void mouseButtonUp() { for (int x = mc.start_x; x <= mc.end_x; x++) { for (int y = mc.start_y; y <= mc.end_y; y++) { Tile t = WorldController.Instance.world.GetTileAt(x, y); // This Places the building instantly at mouse // bc.PlaceBuilding(paintingType, t); if (BuildingController.BuildingTileClear(t) && t.pendingJob == null) { // Job j = new Job(t, (theJob) => { OnBuildingJobComplete(paintingType, theJob.tile); t.pendingJob = null; }); j.JobObjectType = "RockWallTile"; t.world.jobQueue.Enqueue(j); t.pendingJob = j; j.RegisterJobCancelCallBack((theJob) => { theJob.tile.pendingJob = null; }); j.RegisterJobCompleteCallBack((theJob) => { theJob.tile.pendingJob = null; }); } } } }