public void Deserialize(ByteProtocol protocol) { var len = protocol.getInt32(); Debug.LogError("len " + len); if (assets == null) { assets = new List <T>(); } for (int i = 0; i < len; i++) { if (i >= assets.Count) { var assetsData = new T(); assetsData.data = new DataT(); assetsData.data.Deserialize(protocol); assets.Add(assetsData); } else { assets[i].data.Deserialize(protocol); } } for (int i = 0; i < len; i++) { assets[i].Deserialize(protocol); } }
public void Deserialize(ByteProtocol protocol) { dic.Clear(); var len = protocol.getInt32(); for (int i = 0; i < len; i++) { dic.Add(new KeyFixed(protocol.getString(), protocol.getRatio())); } }
public virtual void Deserialize(ByteProtocol protocol) { table.Clear(); var len = protocol.getInt32(); for (int i = 0; i < len; i++) { var data = new T(); data.Deserialize(protocol); table.Add(data.Id, data); } Debug.Log("AI初始化完毕 AI数" + table.Count); }