public void Load(byte[] bytes) { BinaryHelper helper = new BinaryHelper(bytes); int length = helper.ReadInt(); m_magicStoneTableInfoList = new List <MagicStoneTableInfo>(length); for (int index = 0; index < length; ++index) { MagicStoneTableInfo info = new MagicStoneTableInfo(); info.Load(helper); m_magicStoneTableInfoList.Add(info); } }
public void OnMsgSendMagicStoneInfo_S2C(PacketReader p, object state) { Debug.Log("OnMsgSendMagicStoneInfo_S2C"); MagicStoneTableInfo tableInfo = null; int magicStoneListSize = p.ReadInt32(); for (int i = 1; i <= magicStoneListSize; i++) { int magicStoneId = p.ReadInt32(); bool isDiscount = (p.ReadInt32() == 0) ? false : true; MagicStoneInfo stoneInfo = new MagicStoneInfo(); tableInfo = GameTable.MagicStoneTableAsset.Lookup(magicStoneId); if (null != tableInfo) { stoneInfo.m_magicStoneId = magicStoneId; stoneInfo.m_magicStoneNum = tableInfo.magciStoneNumber; stoneInfo.m_magicStonePrice = (isDiscount) ? tableInfo.discountPrice : tableInfo.price; ShopProp.Singleton.m_magicStoneList.Add(stoneInfo); } } ShopProp.Singleton.OnUpdateMagicStoneShop(); }