本文整理汇总了C#中ByteBuffer.readInt方法的典型用法代码示例。如果您正苦于以下问题:C# ByteBuffer.readInt方法的具体用法?C# ByteBuffer.readInt怎么用?C# ByteBuffer.readInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ByteBuffer
的用法示例。
在下文中一共展示了ByteBuffer.readInt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnData
//--------------------------------------
// PUBLIC METHODS
//--------------------------------------
//--------------------------------------
// GET/SET
//--------------------------------------
//--------------------------------------
// EVENTS
//--------------------------------------
private void OnData(GameCenterDataPackage package) {
ByteBuffer b = new ByteBuffer (package.buffer);
int pId = b.readInt();
switch(pId) {
case 1:
Debug.Log("Sphere pack");
Vector3 pos = new Vector3 (0, 0, 1);
pos.x = b.readFloat ();
pos.y = b.readFloat ();
PTPGameController.instance.createRedSphere (pos);
break;
default:
Debug.Log("Got pack wit id: " + pId);
break;
}
}
示例2: bytesRead
public override void bytesRead(ByteBuffer data)
{
base.bytesRead(data);
if (this.isTag(base._tag))
{
this._value = data.readInt();
}
}
示例3: bytesRead
public override void bytesRead(ByteBuffer data)
{
base.bytesRead(data);
if (this.isTag(base._tag))
{
int num = data.readInt();
this._value = new ByteBuffer();
this._value.writeBytes(data, 0, (uint) num);
this._value.position = 0;
data.position += num;
}
ByteBuffer buffer2 = new ByteBuffer(ZIPUtil.Decompress(this._value.toArray()));
buffer2.readByte();
this._erlValue = ByteKit.complexAnalyse(buffer2);
}
示例4: HandleActionDataReceived
//--------------------------------------
// PUBLIC METHODS
//--------------------------------------
//--------------------------------------
// GET/SET
//--------------------------------------
//--------------------------------------
// EVENTS
//--------------------------------------
void HandleActionDataReceived (GK_Player player, byte[] data) {
ByteBuffer b = new ByteBuffer (data);
int pId = b.readInt();
switch(pId) {
case 1:
Debug.Log("Sphere pack");
Vector3 pos = new Vector3 (0, 0, 1);
pos.x = b.readFloat ();
pos.y = b.readFloat ();
PTPGameController.instance.createRedSphere (pos);
break;
default:
Debug.Log("Got pack wit id: " + pId);
break;
}
}
示例5: bytesRead
public override void bytesRead(ByteBuffer data)
{
base.bytesRead(data);
if (base._tag == TAG[0])
{
int num = data.readUnsignedByte();
this._value = new ErlType[num];
for (int i = 0; i < num; i++)
{
this._value[i] = ByteKit.natureAnalyse(data);
}
}
else if (base._tag == TAG[1])
{
int num3 = data.readInt();
this._value = new ErlType[num3];
for (int j = 0; j < num3; j++)
{
this._value[j] = ByteKit.natureAnalyse(data);
}
}
}