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


C# Building.setConflict方法代码示例

本文整理汇总了C#中Building.setConflict方法的典型用法代码示例。如果您正苦于以下问题:C# Building.setConflict方法的具体用法?C# Building.setConflict怎么用?C# Building.setConflict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Building的用法示例。


在下文中一共展示了Building.setConflict方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Place

    //Place a building on specific location
    public void Place(Building building, int x, int y, int rotation, int lastCollection)
    {
        Vector3 newPosition = building.transform.localPosition;
        newPosition.x = x*squareSize.x + building.size.x/2;
        newPosition.z = y*squareSize.y + building.size.y/2;
        building.transform.localPosition = newPosition;
        building.setConflict(!isFree ());
        building.setCoordinates (x, y);
        building.rotation = rotation;
        building.lastCollection = lastCollection;
        buildingManager.addBuilding (building);

        //rotate
        //print ("The rotation is " + rotation.ToString());
        for (int i=0; i<rotation; i++) {
            building.rotate();
        }

        //mark ground taken
        for (int i = 0; i < building.size.x/squareSize.x; i++) {
            for (int j = 0; j < building.size.y/squareSize.y; j++) {
                grid[x+i,y+j] = true;
                highlightGrid[x+i, y+j].renderer.material = redMat;
            }
        }

        HashSet<int> unlocks = building.getUnlockSet ();
        foreach (BuildingButton b in buttons) {
            if (unlocks.Contains(b.prefab.buildingType)) {
                b.prefab.locked = false;
            }
        }
    }
开发者ID:lucyktan,项目名称:ItTakesAVillage,代码行数:34,代码来源:BuildingPlacer.cs


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