コード例 #1
0
        private void SendData()
        {
            //Actualiza rotacion del player y torreta
            player.tankRotation   = transform.localEulerAngles.z.TwoDecimals();
            player.barrelRotation = playerManager.GetLastRotation().TwoDecimals();

            networkIdentity.GetSocked().Emit("updateRotation", new JSONObject(JsonUtility.ToJson(player)));
        }
コード例 #2
0
        //actualiza mi posicion al server
        private void sendData()
        {
            //Actualiza posicion del player
            player.position.x = transform.position.x.TwoDecimals();
            player.position.y = transform.position.y.TwoDecimals();

            networkIdentity.GetSocked().Emit("updatePosition", new JSONObject(JsonUtility.ToJson(player)));
        }