コード例 #1
0
    public void PopulateTypeContainers()
    {
        //load all the things
        //HACK: These loaders are hard coded for now. They should load from IO for mod support.
        LoadTerrainTypes();
        LoadPropertyTypes();
        LoadSquadTypes();

        chosenTerrainType = TypeContainer <TerrainType> .get("Water");

        DebugTerrainType = chosenTerrainType.gameplayData.name;
    }
コード例 #2
0
    private void OnChooseSquad(GameObject go)
    {
        string text = go.name;

        if (text == null)
        {
            return;
        }
        chosenSquadType = TypeContainer <SquadType> .get(text);

        mode = LevelEditorMode.Squad;
    }
コード例 #3
0
    private void OnChooseProperty(GameObject go)
    {
        string text = go.name;

        if (text == null)
        {
            return;
        }
        chosenPropertyType = TypeContainer <PropertyType> .get(text);

        mode = LevelEditorMode.Property;
    }
コード例 #4
0
    private void OnChooseTerrain(GameObject go)
    {
        string text = go.name; //go.GetComponent<UITooltip>().text.text;

        if (text == null)
        {
            return;
        }
        chosenTerrainType = TypeContainer <TerrainType> .get(text);

        mode = LevelEditorMode.Terrain;
    }
コード例 #5
0
ファイル: Board.cs プロジェクト: Kingsquee/Warengine
    void generateNodes()
    {
        //Debug.Log( width );
        //Debug.Log( length );

        TerrainType terra = TypeContainer <TerrainType> .get("Plain");

        //Debug.Log( "TERRAIN TYPE OF TERRA IS " + terra.staticDataame );

        Node n;

        for (int x = 0; x < width; x++)
        {
            for (int z = 0; z < length; z++)
            {
                n           = new Node(terra, new Vector3(x, 0f, z));
                nodes[x, z] = n;
            }
        }


        for (int x = 0; x < width; x++)
        {
            for (int z = 0; z < length; z++)
            {
                n = getNodeUnsafely(x, z);

                n.AssignEdges();
                n.terrain.autoWall();

                if (z == 0 || z == length - 1)
                {
                    SquadInstance.Create(getNodeUnsafely(x, z), TypeContainer <SquadType> .get("placeholder squad"));
                }
            }
        }
    }