public void Init( UIScrollList _list, body2_SC_PRIVATESHOP_SEARCH_RESULT _item, delListBtnClicked _del) { m_SearchInfo = _item; m_Del = _del; listBtn.SetInputDelegate( OnListButton); _list.AddItem( container); Item item = ItemMgr.ItemManagement.GetItem( _item.sItem.nItemTableIdx); GameObject objIcon = item.GetIcon(); objIcon = Instantiate( objIcon) as GameObject; objIcon.transform.parent = objSlot.transform; objIcon.transform.localPosition = Vector3.zero; count_ = objIcon.GetComponentInChildren<SpriteText>(); if( count_ != null && m_SearchInfo.sItem.nOverlapped > 1) count_.Text = m_SearchInfo.sItem.nOverlapped.ToString(); // item number must be added txt_Grade.Text = item.GetStrGrade(); txt_Level.Text = item.ItemData.levelLimit.ToString(); string str = m_SimpleName = AsTableManager.Instance.GetTbl_String(item.ItemData.nameId); if( m_SearchInfo.sItem.nStrengthenCount > 0) str = Color.white + "+" + m_SearchInfo.sItem.nStrengthenCount + " " + m_SimpleName; txt_Name.Text = str; // txt_Price.Text = _item.nItemGold.ToString(); txt_Price.Text = _item.nItemGold.ToString("#,#0", CultureInfo.InvariantCulture); container.ScanChildren(); container.GetScrollList().ClipItems(); }
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; count = new byte[ sizeof( Int32)]; headerinfo = infotype.GetField( "nMaxPageCount", BINDING_FLAGS_PIG); Buffer.BlockCopy( data, index, count, 0, sizeof( Int32)); headerinfo.SetValue( this, BitConverter.ToInt32( count, 0)); index += sizeof( Int32); body = new body2_SC_PRIVATESHOP_SEARCH_RESULT[ nItemCnt]; for( int i = 0; i < nItemCnt; i++) { body[i] = new body2_SC_PRIVATESHOP_SEARCH_RESULT(); byte[] tmpData = new byte[ body2_SC_PRIVATESHOP_SEARCH_RESULT.size]; Buffer.BlockCopy( data, index, tmpData, 0, tmpData.Length); body[i].ByteArrayToClass( tmpData); index += body2_SC_PRIVATESHOP_SEARCH_RESULT.size; } }