コード例 #1
0
ファイル: AsRankListItem.cs プロジェクト: ftcaicai/ArkClient
	public void Init( sRANKINFO data)
	{
		rankInfo = data;

		StringBuilder sb = new StringBuilder();
		sb.AppendFormat( AsTableManager.Instance.GetTbl_String(1766), data.nRank);
		rankText.Text = sb.ToString();
		
		foreach( SimpleSprite cls in classes)
			cls.gameObject.SetActiveRecursively( false);

        if (eCLASS.NONE != data.eClass)
        {
            Debug.LogWarning(data.eClass.ToString());

            classes[(int)data.eClass - 1].gameObject.SetActiveRecursively(true);
        }

		levelText.Text = data.nLevel.ToString();
		nameText.Text = data.szCharName;
		rankPointText.Text = data.nRankPoint.ToString();
		fluctuationPointText.Text = Mathf.Abs( data.nDiffRank).ToString();
		
		foreach( SimpleSprite fluc in fluctuations)
			fluc.gameObject.SetActiveRecursively( false);
		if( 0 == data.nDiffRank)
		{
			fluctuations[1].gameObject.SetActiveRecursively( true);
			fluctuationPointText.Color = new Color( 0.3f, 1.0f, 0.1f, 1.0f);//Color.green;
		}
		else if( 0 < data.nDiffRank)
		{
			fluctuations[2].gameObject.SetActiveRecursively( true);
			fluctuationPointText.Color = new Color( 0.9f, 0.3f, 0.1f, 1.0f);//Color.red;
		}
		else
		{
			fluctuations[0].gameObject.SetActiveRecursively( true);
			fluctuationPointText.Color = new Color( 0.1f, 0.4f, 1.0f, 1.0f);//Color.blue;
		}

		SetDelegateImage();
	}
コード例 #2
0
	public new void PacketBytesToClass( byte[] data)
	{
		Type infotype = this.GetType();
		FieldInfo headerinfo = null;

		int index = ParsePacketHeader( data);

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

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

		// nFriendItemRankMaxCount
		byte[] friendRankMax = new byte[ sizeof( UInt32)];
		headerinfo = infotype.GetField( "nFriendItemRankMaxCount", BINDING_FLAGS_PIG);
		Buffer.BlockCopy( data, index, friendRankMax, 0, sizeof( UInt32));
		headerinfo.SetValue( this, BitConverter.ToUInt32( friendRankMax, 0));
		index += sizeof( UInt32);

		// sRankInfo
		for( int i = 0; i < (int)eRANKVALUE.eRANKVALUE_MAXCOUNT_PER_PAGE; i++)
		{
			sRankInfo[i] = new sRANKINFO();
			index = sRankInfo[i].PacketBytesToClass( data, index);
		}
	}