void emitAxisChange(string axis, float value) { if (ClientManager.instance.state != BaseNetworking.componentState.RUNNING || ClientManager.instance.workerClient == null) { return; } InputAxisMessage message = new InputAxisMessage(); message.axis = axis; message.value = value; ClientManager.instance.workerClient.sendMessage(message); }
public override void handleMessage(QTMessage message) { switch (message.messageType) { case QTMessage.type.INPUT: InputMessage inputMessage = (InputMessage)message; if (inputMessage.active) { onClientKeyDown(inputMessage.keyCode); } else { onClientKeyUp(inputMessage.keyCode); } break; case QTMessage.type.INPUT_AXIS: InputAxisMessage inputAxisMessage = (InputAxisMessage)message; updateAxisState(inputAxisMessage.axis, inputAxisMessage.value); break; case QTMessage.type.VR_ACTION: VRActionMessage actionMessage = (VRActionMessage)message; updateVRAction(actionMessage.actionName, QTUtils.getValueFromVRActionMessage(actionMessage)); break; case QTMessage.type.SYNC_VR_POSITION: SyncVRPositionMessage positionMessage = (SyncVRPositionMessage)message; updateVRPosition(positionMessage.source, new Vector3(positionMessage.posX, positionMessage.posY, positionMessage.posZ)); break; case QTMessage.type.SYNC_VR_ROTATION: SyncVRRotationMessage rotationMessage = (SyncVRRotationMessage)message; updateVRRotation(rotationMessage.source, new Vector3(rotationMessage.rotX, rotationMessage.rotY, rotationMessage.rotZ)); break; } }