public void Set(BuildingProfile _buildingProfile) { buildingProfile = _buildingProfile; building = Instantiate(buildingProfile.Prefab, transform); buildingManager = building.GetComponent <BuildingManager>(); StartCoroutine(BuildingPositionUpdate()); GlobalData.IsPlaceManagerActive = true; }
private bool UpdateResources(BuildingProfile building) { bool isWork = TryGetResources(building.RequiredResources); if (isWork) { AddResources(building.ProducedResources); } return(isWork); }
//for each game, select a subset from GameController's tower profile library //and assign it to GridCityManager's gameProfileArray public void RandomizeTowerFlavours() { int arraySize = Random.Range(1, profileLibraryArray.Length); BuildingProfile[] profileArray = new BuildingProfile[arraySize]; for (int i = 0; i < arraySize; i++) { int rnd = Random.Range(0, profileLibraryArray.Length); profileArray[i] = profileLibraryArray[rnd]; } cityManager.gameProfileArray = profileArray; }
public void SetProfile(BuildingProfile profile) { myProfile = profile; maxLevel = myProfile.maxHeight; }
public void Set(BuildingProfile _buildingProfile, Transform _buildingsParent) { buildingProfile = _buildingProfile; buildingsParent = _buildingsParent; }
public void AddBuilding(BuildingProfile buildingProfile, GameObject buildingObject) { buildings.Add(new Building(buildingProfile.Type, buildingObject.transform.position, buildingObject.transform.rotation, true)); buildingObjects.Add(buildingObject); }
public void SetProfile(BuildingProfile profile) { myProfile = profile; myProfile.maxHeight = Random.Range(4, 7); maxLevel = myProfile.maxHeight; }
public void SetProfile(BuildingProfile profile) { myProfile = profile; }