public void EnableBuilding() // Call this to spawn the building { if (!disablePurchase && economyManager.GetBalance() > price && containedBuilding) { economyManager.MakePurchase(price); SizeForPlay(); DeselectBuilding(); if (containedBuilding.tag == "industrial" || containedBuilding.tag == "industrialComponent") // Smoke deactivation { foreach (Transform child in containedBuilding.transform) { child.gameObject.SetActive(true); } } else if (containedBuilding.tag == "service") { serv.AddService(); } EnablePhysics(); if (containedType == 0) { EnableResidential(); } else if (containedType == 1) { EnableCommercial(); } else if (containedType == 2) { EnableIndustrial(); } else if (containedType == 3) { EnableCommercial(); } else if (containedType == 4) { EnableComponent(); } else if (containedType == 5) { EnableFoliage(); } else if (containedType == 6) { EnableService(); } // Spawns new from here!!!!! showingBuilding = false; spawnManager.SpawnUIBuildings(displayUI.GetSelection(), thumb.angleIncrement); } else { economyManager.FailedPurchase(); } }
void SendPosition() // Sends new swipe info to displayUI { int selection = displayUI.GetSelection(); if (swipe > swipeReq) { U.LeftPulse(); U.PlayClick(); if (displayUI.showBuildings && angleIncrement + 4 < spawnManager.GetNumBuildings(selection)) { angleIncrement++; spawnManager.SpawnUIBuildings(selection, angleIncrement); } else if (!displayUI.showBuildings) { displayUI.SendSwipe(1); } swipe = 0; } else if (swipe < -swipeReq) { U.LeftPulse(); U.PlayClick(); if (displayUI.showBuildings && angleIncrement >= 1) { angleIncrement--; spawnManager.SpawnUIBuildings(selection, angleIncrement); } else if (!displayUI.showBuildings) { displayUI.SendSwipe(-1); } swipe = 0; } }