本文整理汇总了C#中SFSObject.PutFloatArray方法的典型用法代码示例。如果您正苦于以下问题:C# SFSObject.PutFloatArray方法的具体用法?C# SFSObject.PutFloatArray怎么用?C# SFSObject.PutFloatArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SFSObject
的用法示例。
在下文中一共展示了SFSObject.PutFloatArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
void Update()
{
if (!theUI.GetchatTBFocus())
{
if (Input.GetKeyDown(KeyCode.W))
{
this.MecAnim.SetBool(RUN_ANIMATION, true);
ISFSObject ObjectIn = new SFSObject();
ObjectIn.PutFloatArray("Location", ourLPC.GetLocation());
ObjectIn.PutBool("IsMoving", true);
SFServer.Send(new ExtensionRequest("PositionUpdate", ObjectIn));
// First rotation
this.PlayerRB.transform.Rotate(0, crosshairTransform.localRotation.eulerAngles.y, 0);
crosshairTransform.localRotation = Quaternion.Euler(crosshairTransform.localEulerAngles.x, 0, crosshairTransform.localEulerAngles.z);
crosshairTransform.localPosition = new Vector3(1f, 2.5f, 1.0f);
ObjectIn = new SFSObject();
ObjectIn.PutFloat("Rotation", ourLPC.GetRotation());
SFServer.Send(new ExtensionRequest("RotationUpdate", ObjectIn));
}
if (Input.GetKeyUp(KeyCode.W))
{
this.MecAnim.SetBool(RUN_ANIMATION, false);
ISFSObject ObjectIn = new SFSObject();
ObjectIn.PutFloatArray("Location", ourLPC.GetLocation());
ObjectIn.PutBool("IsMoving", false);
SFServer.Send(new ExtensionRequest("PositionUpdate", ObjectIn));
}
if (Input.GetKey(KeyCode.W))
{
CameraController cameraControllerObj = (CameraController)Camera.main.GetComponent("CameraController");
cameraControllerObj.setCursorVisible(false);
this.PlayerRB.MovePosition(transform.position + (transform.forward * Time.deltaTime * PlayerSpeed));
}
if (Input.GetKey(KeyCode.W) && Input.GetAxis("Mouse X") != 0)
{
// Take Cross Hair's rotate, and reset crosshair
this.PlayerRB.transform.Rotate(0, crosshairTransform.localRotation.eulerAngles.y, 0);
crosshairTransform.localRotation = Quaternion.Euler(crosshairTransform.localEulerAngles.x, 0, crosshairTransform.localEulerAngles.z);
crosshairTransform.localPosition = new Vector3(1f, 2.5f, 1.0f);
ISFSObject ObjectIn = new SFSObject();
ObjectIn.PutFloat("Rotation", ourLPC.GetRotation());
SFServer.Send(new ExtensionRequest("RotationUpdate", ObjectIn));
}
if (Input.GetKeyDown(KeyCode.F))
{
if (ourLPC.getPlayerAction() != null)
{
ourLPC.getPlayerAction().performAction(GameObject.Find("SceneScriptsObject"));
}
}
}
}
示例2: sendBlockDataSFSMessage
private void sendBlockDataSFSMessage(object sender, DoWorkEventArgs e)
{
var blocks = e.Argument as List<float[]>;
var obj = new SFSObject();
obj.PutUtfString("type", "sync");
var blocksArray = new SFSArray();
foreach (var block in blocks) {
var blockData = new SFSObject();
blockData.PutFloatArray("position", new[] {block[0], block[1]});
blockData.PutFloatArray("velocity", new[] {block[2], block[3]});
blocksArray.AddSFSObject(blockData);
}
obj.PutSFSArray("blocks", blocksArray);
smartFox.Send (new ObjectMessageRequest(obj));
}
示例3: sendExplosionForce
void sendExplosionForce(Vector3 location, float force)
{
ISFSObject sendExplosion = new SFSObject();
sendExplosion.PutUtfString("type", "explosion");
if (isBlueTeam)
{
sendExplosion.PutUtfString("team", "blue");
}
else
{
sendExplosion.PutUtfString("team", "red");
}
sendExplosion.PutFloat("force", force);
sendExplosion.PutFloatArray("pos", new[] {location.x, location.z});
smartFox.Send(new ObjectMessageRequest(sendExplosion, null, smartFox.LastJoinedRoom.UserList));
}