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


C# SFSObject.PutFloat方法代码示例

本文整理汇总了C#中SFSObject.PutFloat方法的典型用法代码示例。如果您正苦于以下问题:C# SFSObject.PutFloat方法的具体用法?C# SFSObject.PutFloat怎么用?C# SFSObject.PutFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SFSObject的用法示例。


在下文中一共展示了SFSObject.PutFloat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendPublicMessageForSyncMove

 public void SendPublicMessageForSyncMove(int myPlayerId, Vector3 destination)
 {
     SFSObject obj = new SFSObject();
     obj.PutUtfString("username", userName + myPlayerId);
     obj.PutFloat("destinationx", destination.x);
     obj.PutFloat("destinationy", destination.y);
     obj.PutFloat("destinationz", destination.z);
     sfs.Send(new PublicMessageRequest("move", obj));
 }
开发者ID:duylinh2109,项目名称:ProjectIII,代码行数:9,代码来源:SmartFoxInGame.cs

示例2: SendPublicMessageRequestFire

 public void SendPublicMessageRequestFire(int myPlayerID, int shootPower, float directX, float directY)
 {
     SFSObject obj = new SFSObject();
     obj.PutUtfString("username", userName + myPlayerID);
     obj.PutInt("shootpower", shootPower);
     obj.PutFloat("directx", directX);
     obj.PutFloat("directy", directY);
     sfs.Send(new PublicMessageRequest("playerfire", obj));
 }
开发者ID:duylinh2109,项目名称:ProjectIII,代码行数:9,代码来源:SmartFoxInGame.cs

示例3: PlayerMove

    public void PlayerMove(float x, float y, float z)
    {
        //Debug.Log("PlayerMove: " + x + " " + y + " " + z);
        ISFSObject obj = new SFSObject();
        obj.PutFloat("x", x);
        obj.PutFloat("y", y);
        obj.PutFloat("z", z);

        sfs.Send(new ExtensionRequest(Commands.MOVE, obj, sfs.LastJoinedRoom));
    }
开发者ID:rivalstudios,项目名称:MTGClient,代码行数:10,代码来源:MTGGame.cs

示例4: InviaAnimazioneControllerTast

 public static void InviaAnimazioneControllerTast(int userId, float forward, float turn,bool onGround , float jump , float jumpLeg,bool attacco1,bool attacco2)
 {
     SFSObject objOut = new SFSObject();
     objOut.PutFloat("f", forward);
     objOut.PutFloat("t", turn);
     objOut.PutBool("o", onGround);
     objOut.PutFloat("j", jump);
     objOut.PutFloat("jL", jumpLeg);
     objOut.PutBool("a1", attacco1);
     objOut.PutBool("a2", attacco2);
     me.sfs.Send(new ExtensionRequest("SanT", objOut,me. sfs.LastJoinedRoom));
 }
开发者ID:LucaGames,项目名称:ClassPrjUnit4-5,代码行数:12,代码来源:ManagerNetwork.cs

示例5: Compress

 protected void Compress()
 {
     GameObject tetrisDropper = GameObject.Find ("TetrisDropper");
     GameObject gameManager = GameObject.Find ("GameManager");
     SFSObject createBlockMessage = new SFSObject ();
     createBlockMessage.PutUtfString ("messageType", "RequestCreate");
     createBlockMessage.PutUtfString ("objectType", "Block");
     createBlockMessage.PutFloat ("xPos", tetrisDropper.transform.position.x);
     createBlockMessage.PutFloat ("yPos", tetrisDropper.transform.position.y);
     createBlockMessage.PutFloat ("zPos", tetrisDropper.transform.position.z);
     gameManager.SendMessage ("SendData", createBlockMessage);
 }
开发者ID:xzs424,项目名称:PunchMe,代码行数:12,代码来源:TetrisBlockRequestMessage.cs

示例6: InviaAnimazioneControllerClick

 public static void InviaAnimazioneControllerClick(int userId, float forward, bool attacco1, bool attacco2)
 {
     SFSObject objOut = new SFSObject();
     objOut.PutFloat("f", forward);
     objOut.PutBool("a1", attacco1);
     objOut.PutBool("a2", attacco2);
     me.sfs.Send(new ExtensionRequest("SanC", objOut, me.sfs.LastJoinedRoom));
 }
开发者ID:LucaGames,项目名称:ClassPrjUnit4-5,代码行数:8,代码来源:ManagerNetwork.cs

示例7: 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

示例8: InviaTransformLocali

 //MODIFICA BY LUCA
 /*
 private void InviaTransformLocali()
 {
     ISFSObject objOut = new SFSObject();
     objOut.PutFloat("x", Statici.playerLocaleGO.transform.position.x);
     objOut.PutFloat("y", Statici.playerLocaleGO.transform.position.y);
     objOut.PutFloat("z", Statici.playerLocaleGO.transform.position.z);
     objOut.PutFloat("rot", Statici.playerLocaleGO.transform.rotation.eulerAngles.y);
     sfs.Send(new ExtensionRequest("regT", objOut, sfs.LastJoinedRoom));
     controllerPlayer.MovementDirty = false;
 }
 */
 public static void InviaTransformLocali(NetworkTransform ne)
 {
     ISFSObject objOut = new SFSObject();
     objOut.PutFloat("x", ne.position.x);
     objOut.PutFloat("y", ne.position.y);
     objOut.PutFloat("z", ne.position.z);
     objOut.PutFloat("rx", ne.rotation.x);
     objOut.PutFloat("ry", ne.rotation.y);
     objOut.PutFloat("rz", ne.rotation.z);
     me.sfs.Send(new ExtensionRequest("regT", objOut, me.sfs.LastJoinedRoom));
       //  me.controllerPlayer.MovementDirty = false;
 }
开发者ID:LucaGames,项目名称:ClassPrjUnit4-5,代码行数:25,代码来源:ManagerNetwork.cs

示例9: SendStatusChange

 void SendStatusChange()
 {
     pendingSend = false;
     ISFSObject data = new SFSObject();
     ISFSObject tr = new SFSObject();
     if(sendHP){
         Debug.Log("Sending status change: " + component.HP);
         tr.PutFloat("currentHP", component.HP);
     }
     data.PutSFSObject(NetSyncObjCharacter.statusDS, tr);
     data.PutInt("id", syncObj.ID);
     SFSNetworkManager.Instance.SendNetObjSync(data);
 }
开发者ID:claw2013hku,项目名称:UnityTestProject,代码行数:13,代码来源:ActorStatusSend.cs

示例10: TransformToSFSObject

    public static ISFSObject TransformToSFSObject(Vector3 pos, Vector3 angles)
    {
        ISFSObject data = new SFSObject();

        data.PutUtfString("type", "transform");
        data.PutFloat("x", pos.x);
        data.PutFloat("y", pos.y);
        data.PutFloat("z", pos.z);

        data.PutFloat("rx", angles.x);
        data.PutFloat("ry", angles.y);
        data.PutFloat("rz", angles.z);
        return data;
    }
开发者ID:Daminvar,项目名称:Scatterblocks,代码行数:14,代码来源:NetworkHelper.cs

示例11: SendData

    public void SendData(Transform a)
    {
        ISFSObject isfsO = new SFSObject();
        isfsO.PutInt("Sender", sfs.MySelf.PlayerId);

        isfsO.PutFloat("px", a.position.x);
        isfsO.PutFloat("py", a.position.y);
        isfsO.PutFloat("pz", a.position.z);

        isfsO.PutFloat("rx", a.rotation.x);
        isfsO.PutFloat("ry", a.rotation.y);
        isfsO.PutFloat("rz", a.rotation.z);

        sfs.Send(new ExtensionRequest(ConfigRequestCmd.cmd_playermove, isfsO, sfs.LastJoinedRoom));
    }
开发者ID:fmo080308,项目名称:TinyTroop,代码行数:15,代码来源:SmartFoxInGame.cs

示例12: SendFireRequest

    private void SendFireRequest( object data )
    {
        SFSObject sfsdata = new SFSObject ();
        Dictionary<string, object> firedata = data as Dictionary<string, object>;

        sfsdata.PutFloat ( "damage", ( float ) firedata[ "damage" ] );
        sfsdata.PutUtfString("type", (string)firedata["type"]);
        sfsdata.PutInt ( "player.hit.id", ( int ) firedata[ "player.hit.id" ] );

        sfsdata.PutFloat ( "contact.point.x", ( float ) firedata[ "contact.point.x" ] );
        sfsdata.PutFloat ( "contact.point.y", ( float ) firedata[ "contact.point.y" ] );
        sfsdata.PutFloat ( "contact.point.z", ( float ) firedata[ "contact.point.z" ] );

        SFSInstance.Send ( new ExtensionRequest ( "server.fire", sfsdata, SFSInstance.LastJoinedRoom, useUDP ) );
    }
开发者ID:hollsteinm,项目名称:GSPSeniorProject,代码行数:15,代码来源:SFSClient.cs

示例13: ToSFSObject

    // Stores the transform values to SFSObject to send them to server
    public ISFSObject ToSFSObject(ISFSObject data)
    {
        ISFSObject launchMessage = new SFSObject();

        //Message
        launchMessage.PutUtfString("messageType", type);

        //side hit id
        launchMessage.PutInt("cubeID", cubeID);

        //side hit id
        launchMessage.PutInt("sideID", sideID);

        // Launch Position
        launchMessage.PutFloat("sx", this.launchPosition.x);
        launchMessage.PutFloat("sy", this.launchPosition.y);
        launchMessage.PutFloat("sz", this.launchPosition.z);

        // Launch Destination
        launchMessage.PutFloat("ex", this.launchDestination.x);
        launchMessage.PutFloat("ey", this.launchDestination.y);
        launchMessage.PutFloat("ez", this.launchDestination.z);

        //Local Game Time
        launchMessage.PutDouble("localGameTime", this.localGameTime);

        //Local Game Time
        launchMessage.PutDouble("gameTimeETA", this.gameTimeETA);

        data.PutSFSObject("launchMessage", launchMessage);

        return data;
    }
开发者ID:ice0001,项目名称:Cubes-in-Space,代码行数:34,代码来源:LaunchPacket.cs

示例14: toSFSObject

 public override SFSObject toSFSObject()
 {
     SFSObject storyObject = new SFSObject();
     storyObject.PutLong("id_UserStory", this.getId_UserStory());
     storyObject.PutLong ("Id_Sprint", this.id_Sprint);
     storyObject.PutInt("prioridad", this.getPrioridad());
     storyObject.PutUtfString("descripcion", this.getDescripcion());
     storyObject.PutSFSArray("listaTareas", this.getListaTareasToSFSArray());
     storyObject.PutSFSArray("listaEstimacion", this.getListaEstimacionToSFSArray());
     storyObject.PutSFSArray ("listaCriterios", this.getListaCriteriosToSFSArray ());
     storyObject.PutInt("estadoEstimacion",this.getEstadoEstimacion());
     storyObject.PutFloat("valorEstimacion",this.getValorEstimacion());
     storyObject.PutLong("id_proyecto",this.getProyecto());
     storyObject.PutUtfString("Titulo",this.getTitulo());
     storyObject.PutBool("cerrada", this.cerrada);
     storyObject.PutUtfString ("fecha_ultimo_cambio", this.get_fecha_ultimo_cambio ().ToString());
     return storyObject;
 }
开发者ID:CristianCosta,项目名称:Kinect,代码行数:18,代码来源:UserStory.cs

示例15: OnStartGame

    private void OnStartGame()
    {
        if (sfs.MySelf.PlayerId == 1)
        {
            player = (GameObject)Instantiate(Resources.Load("Prefabs/player", typeof(GameObject)), new Vector3(-5, 0, 0), Quaternion.identity);
            player.gameObject.name = userName + sfs.MySelf.PlayerId.ToString();
        }
        else if (sfs.MySelf.PlayerId == 2)
        {
            player = (GameObject)Instantiate(Resources.Load("Prefabs/player", typeof(GameObject)), new Vector3(5, 0, 0), Quaternion.identity);
            player.name = userName + sfs.MySelf.PlayerId;
        }

        SFSObject obj = new SFSObject();
        obj.PutUtfString("username", userName + sfs.MySelf.PlayerId);
        obj.PutFloat("x", player.transform.position.x);
        obj.PutFloat("y", player.transform.position.y);
        obj.PutFloat("z", player.transform.position.z);

        sfs.Send(new PublicMessageRequest("newplayerjoingame", obj));
    }
开发者ID:duylinh2109,项目名称:ProjectIII,代码行数:21,代码来源:SmartFoxInGame.cs


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