本文整理汇总了C#中Building.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Building.ToString方法的具体用法?C# Building.ToString怎么用?C# Building.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Building
的用法示例。
在下文中一共展示了Building.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpawnBuilding
private void SpawnBuilding(Building building)
{
GameObject prefab;
if (building is HouseBuilding)
prefab = houseBuildingPrefab;
else if (building is VillaBuilding)
prefab = villaBuildingPrefab;
else if (building is ClubBuilding)
prefab = clubBuildingPrefab;
else if (building is KebabBuilding)
prefab = kebabBuildingPrefab;
else if (building is PoliceBuilding)
prefab = policeBuildingPrefab;
else
throw new Exception("Not supporting building type " + building.GetType());
GameObject buildingGameObject = SpawnObject(prefab, building.ToString(), building.tile.x, building.tile.z, buildingContainer);
BuildingController buildingController = buildingGameObject.GetComponent<BuildingController>();
buildingController.SetBuilding(building);
}
示例2: BuildNewBuilding
public static void BuildNewBuilding(Building.BuildingType type)
{
if (s_Instance == null) return;
if (type == Building.BuildingType.None) return;
s_Instance._World.IncreaseWorldSize();
GameObject buildingObject = (GameObject)Instantiate(Resources.Load("Prefabs/Building_" + type.ToString()));
buildingObject.name = "Building" + type.ToString();
Transform buildingTransform = buildingObject.transform;
buildingTransform.parent = s_Instance._BuildingsTransform;
buildingTransform.localPosition = new Vector3(s_Instance._BuildingNone.Position(), 0, 0);
Building building = buildingObject.GetComponent<Building>();
s_Instance._Buildings.Add(building);
s_Instance._BuildingNone.MovePosition(World.TILE_WIDTH * World.TILE_PER_ADDITION);
//Update camera drag
float offset = (float)Screen.width * 768f / (float)Screen.height;
s_Instance._CameraDrag.MaxX = s_Instance._World.Width - offset;
//Update mukya end
Mukya.END_X = s_Instance._World.Width - 25f;
//Begin analytics
Reta.Instance.EndTimedRecord("Level Duration");
List<Parameter> parameterLevel = new List<Parameter>();
parameterLevel.Add(new Parameter("Level", s_Instance._World.Size.ToString()));
Reta.Instance.Record("Level Duration", parameterLevel, true);
List<Parameter> parameterProgression = new List<Parameter>();
parameterProgression.Add(new Parameter("Increase", "5"));
Reta.Instance.Record("Game Progression", parameterProgression);
//End analytics
//Save
s_Instance.StartCoroutine(s_Instance.SaveGameCoroutine());
}