예제 #1
0
    void OnEnemyArmRotate(NetworkMessage netMsg)
    {
        PlayerQuaternion enemyRot = netMsg.ReadMessage <PlayerQuaternion>();

        //TODO: not necessary for now, check later if it's worth it.
        players[enemyRot.id].GetComponent <enemy>().setArmRotation(enemyRot.quaternion);
    }
예제 #2
0
    void OnPlayerArmRot(NetworkMessage netMsg)
    {
        NetQuaternion    netArmRot = netMsg.ReadMessage <NetQuaternion>();
        PlayerQuaternion armRot    = new PlayerQuaternion();

        armRot.id         = netMsg.conn.connectionId;
        armRot.quaternion = netArmRot.value;
        sendToAllExcept(netMsg.conn.connectionId, 917, armRot);

        /*foreach(User u in ConnectedUsers.FindAll(x => x.id != netMsg.conn.connectionId)){
         *              NetworkServer.SendToClient(u.id,910,playerRot);
         *      }*/
    }
예제 #3
0
    void OnPlayerRotationChange(NetworkMessage netMsg)
    {
        NetQuaternion    rotUpdate = netMsg.ReadMessage <NetQuaternion>();
        PlayerQuaternion playerRot = new PlayerQuaternion();

        playerRot.id         = netMsg.conn.connectionId;
        playerRot.quaternion = rotUpdate.value;
        sendToAllExcept(netMsg.conn.connectionId, 910, playerRot);

        /*foreach(User u in ConnectedUsers.FindAll(x => x.id != netMsg.conn.connectionId)){
         *              NetworkServer.SendToClient(u.id,910,playerRot);
         *      }*/
        ConnectedUsers.Find(x => x.id == netMsg.conn.connectionId).rotation = rotUpdate.value;
    }