Example #1
0
    public IEnumerator ReadConfig()
    {
        string path = PathUtil.StreamingPath("Config/T_Map.bytes");
        WWW    data = new WWW(path);

        yield return(data);

        MemoryStream stream = new MemoryStream(data.bytes);

        stream.Position = 0;

        T_Map byteObj = new T_Map();

        byteObj.SetStream(stream);
        size = byteObj.ReadInt();

        for (int i = 0; i < size; i++)
        {
            T_Map item = new T_Map();
            item.Deserialization(stream);

            //		if(!groupData.ContainsKey()){
            //			groupData[] = new List<T_Map>();
            //		}
            //		groupData[].Add(item);

            if (itemData.ContainsKey(item.Id))
            {
                Loger.Error("T_Map is Repeat KEY = " + item.Id);
            }
            itemData[item.Id] = item;
        }

        Loger.Info("T_Map Config load Complete, size:" + size);
    }
Example #2
0
 public Map(T_Map map)
 {
     map_id         = map.map_id;
     map_name       = map.map_name;
     required_level = map.required_level;
     if (map.is_pvp == 1)
     {
         is_pvp = true;
     }
     else
     {
         is_pvp = false;
     }
     boxes_on_map   = new List <Box>();
     enemies_on_map = new List <Ship_Enemie>();
 }