Example #1
0
    private static GameObject CreateTile(int x, int y)
    {
        if (map[x, y] == "0")
        {
            return(null);
        }

        Vector3 topLeft      = new Vector3(-tileWidth * (float)map.GetLength(0) / 2.0f, 0, tileHeight * (float)map.GetLength(1) / 2.0f);
        Vector3 displacement = new Vector3(tileWidth * x, 0, -tileHeight * y);

        return((GameObject)MonoBehaviour.Instantiate(Resources.Load(IsoResources.Get(map[x, y])), topLeft + displacement, Quaternion.identity));
    }
 void Awake()
 {
     IsoResources.Load("Assets/Config/Resources.cfg");
     IsoCamera.Init();
     IsoMap.Load("Assets/Maps/TestMap1.map");
 }