コード例 #1
0
    TileUnit genNode(string type, Vector3 pos)
    {
        TileUnit tu = new TileUnit();

        GameObject t = null;

        switch (type)
        {
        case "red":
            t = Instantiate(Resources.Load("RedCube"), pos, Quaternion.identity) as GameObject;
            tu.init(t, null, null, null, null, false);
            break;

        case "green":
            t = Instantiate(Resources.Load("GreenCube"), pos, Quaternion.identity) as GameObject;
            tu.init(t, null, null, null, null, true);
            break;
        }

        switch (type)
        {
        case "green":
            greenTiles.Add(tu);
            break;

        case "red":
            redTiles.Add(tu);
            break;
        }
        return(tu);
    }
コード例 #2
0
ファイル: Tilemap.cs プロジェクト: aadityak/SimpleWalk
    TileUnit genNode(string type, Vector3 pos)
    {
        TileUnit tu = new TileUnit();

        GameObject t = null;
        switch(type) {
            case "red":
                t = Instantiate (Resources.Load("RedCube"), pos ,Quaternion.identity) as GameObject;
                tu.init(t,null,null,null,null,false);
                break;
            case "green":
                t = Instantiate (Resources.Load("GreenCube"), pos ,Quaternion.identity) as GameObject;
                tu.init(t,null,null,null,null,true);
                break;
        }

        switch(type) {
            case "green":
                greenTiles.Add(tu);
                break;
            case "red":
                redTiles.Add(tu);
                break;
        }
        return tu;
    }