示例#1
0
    protected Dictionary<string, CMJ2TileConfig> tileConfig()
    {
        Dictionary<string, CMJ2TileConfig> map = new Dictionary<string, CMJ2TileConfig>();
        string txt = System.IO.File.ReadAllText(Application.dataPath + "/Levels/config_tiles.json");
        Hashtable configData = MiniJSON.jsonDecode(txt) as Hashtable;

        foreach (Hashtable objData in (configData["objects"] as ArrayList))
        {
            CMJ2TileConfig config = new CMJ2TileConfig(objData);
            map.Add(config.m_name, config);
        }
        return map;
    }
示例#2
0
 // Create from config object at location
 public CMJ2Object(CMJ2TileConfig config, Cell cell)
 {
     m_prefab = config.m_prefab;
     m_cell = cell;
     m_pos = CMJ2EnvironmentManager.g.CellToWorldPos(m_cell, config.m_zDepth);
 }