コード例 #1
0
    void TerrainEditorUpdate()
    {
        if (!Input.GetMouseButton(0))
        {
            return;
        }

        if (cursorInfo.transform != null && UICamera.hoveredObject == null)
        {
            tile = cursorInfo.transform.GetComponent <Tile>();

            if (tile != null)
            {
                if (tile.node.terrain == null)
                {
                    TerrainInstance.Create(tile.node, chosenTerrainType);   //this should never be necessary.
                }
                else if (tile.node.terrain.type != chosenTerrainType)
                {
                    TerrainInstance.Replace(tile.node.terrain, chosenTerrainType);
                }
            }
        }
    }
コード例 #2
0
ファイル: Node.cs プロジェクト: Kingsquee/Warengine
    //Visibility Data


    public Node(TerrainType terrainType, Vector3 position)
    {
        this.position = position;
        Tile.Create(this);
        TerrainInstance.Create(this, terrainType);
    }