本文整理汇总了C#中ByteBuffer.readFloat方法的典型用法代码示例。如果您正苦于以下问题:C# ByteBuffer.readFloat方法的具体用法?C# ByteBuffer.readFloat怎么用?C# ByteBuffer.readFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ByteBuffer
的用法示例。
在下文中一共展示了ByteBuffer.readFloat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
}