当前位置: 首页>>代码示例>>C#>>正文


C# Building.ToString方法代码示例

本文整理汇总了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);
    }
开发者ID:bjorntore,项目名称:KebabOslo,代码行数:20,代码来源:WorldController.cs

示例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());
    }
开发者ID:hitnoodle,项目名称:Reta-Eden,代码行数:45,代码来源:MainSceneController.cs


注:本文中的Building.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。