当前位置: 首页>>代码示例>>C#>>正文


C# SFSObject.PutFloatArray方法代码示例

本文整理汇总了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"));
                }
            }
        }
    }
开发者ID:Gabe-Biele,项目名称:Project-Circleage,代码行数:56,代码来源:InputController.cs

示例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));
 }
开发者ID:Daminvar,项目名称:Scatterblocks,代码行数:15,代码来源:GameManager.cs

示例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));
 }
开发者ID:Daminvar,项目名称:Scatterblocks,代码行数:16,代码来源:ClickPlane.cs


注:本文中的SFSObject.PutFloatArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。