示例#1
0
	public bool CreateSlotItem( body2_SC_PRIVATESHOP_ITEMLIST _item, Transform trmParent = null)
	{
		if( null == _item)
		{
			Debug.LogError( "UIPStoreSlot::CreateSlotItem() [ null == _item ]");
			return false;
		}

		return _CreateSlotItem( _item.sItem, -1, _item.nItemGold, trmParent);
	}
示例#2
0
	public new void PacketBytesToClass( byte[] data)
	{
		Type infotype = this.GetType();
		FieldInfo headerinfo = null;

		int index = ParsePacketHeader( data);

		byte[] count = new byte[ sizeof( Int32)];
		headerinfo = infotype.GetField( "nItemCnt", BINDING_FLAGS_PIG);
		Buffer.BlockCopy( data, index, count, 0, sizeof( Int32));
		headerinfo.SetValue( this, BitConverter.ToInt32( count, 0));
		index += sizeof( Int32);

		if( 0 >= nItemCnt)
			return;

		body = new body2_SC_PRIVATESHOP_ITEMLIST[ nItemCnt];
		for( int i = 0; i < nItemCnt; i++)
		{
			body[i] = new body2_SC_PRIVATESHOP_ITEMLIST();
			byte[] tmpData = new byte[ body2_SC_PRIVATESHOP_ITEMLIST.size];
			Buffer.BlockCopy( data, index, tmpData, 0, tmpData.Length);
			body[i].ByteArrayToClass( tmpData);
			index += body2_SC_PRIVATESHOP_ITEMLIST.size;
		}
	}