public void Set(BuildingProfile _buildingProfile)
 {
     buildingProfile = _buildingProfile;
     building        = Instantiate(buildingProfile.Prefab, transform);
     buildingManager = building.GetComponent <BuildingManager>();
     StartCoroutine(BuildingPositionUpdate());
     GlobalData.IsPlaceManagerActive = true;
 }
예제 #2
0
    private bool UpdateResources(BuildingProfile building)
    {
        bool isWork = TryGetResources(building.RequiredResources);

        if (isWork)
        {
            AddResources(building.ProducedResources);
        }
        return(isWork);
    }
예제 #3
0
        //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;
        }
예제 #4
0
 public void SetProfile(BuildingProfile profile)
 {
     myProfile = profile;
     maxLevel  = myProfile.maxHeight;
 }
예제 #5
0
 public void Set(BuildingProfile _buildingProfile, Transform _buildingsParent)
 {
     buildingProfile = _buildingProfile;
     buildingsParent = _buildingsParent;
 }
예제 #6
0
 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;
 }
예제 #8
0
 public void SetProfile(BuildingProfile profile)
 {
     myProfile = profile;
 }