// Use this for initialization void Start() { bTexturesInitialized = false; editorConnection = EditorConnection.instance; editorConnection.Initialize(); editorConnection.RegisterConnection(PlayerConnected); editorConnection.RegisterDisconnection(PlayerDisconnected); editorConnection.Register(ConnectionMessageIds.updateCameraFrameMsgId, UpdateCameraFrame); //editorConnection.Register (ConnectionMessageIds.addPlaneAnchorMsgeId, AddPlaneAnchor); //editorConnection.Register (ConnectionMessageIds.updatePlaneAnchorMsgeId, UpdatePlaneAnchor); //editorConnection.Register (ConnectionMessageIds.removePlaneAnchorMsgeId, RemovePlaneAnchor); //editorConnection.Register (ConnectionMessageIds.screenCaptureYMsgId, ReceiveRemoteScreenYTex); //editorConnection.Register (ConnectionMessageIds.screenCaptureUVMsgId, ReceiveRemoteScreenUVTex); editorConnection.Register(ConnectionMessageIds.screenCaptureRenTextureMsgId, ReceiveRemoteScreenRT); }
private void OnEnable() { editorConnection = EditorConnection.instance; editorConnection.Initialize(); editorConnection.RegisterConnection(OnPlayerConnected); editorConnection.RegisterDisconnection(OnPlayerDisconnected); editorConnection.Register(EditorConnectionMessageID.Player, OnPlayerMessageReceived); PlayerConnectorAttribute.Connect(this); }
// スタート時に呼ばれる void Start() { _bTexturesInitialized = false; _editorConnection = EditorConnection.instance; _editorConnection.Initialize(); _editorConnection.RegisterConnection(PlayerConnected); _editorConnection.RegisterDisconnection(PlayerDisconnected); _editorConnection.Register(ConnectionMessageIds.updateCameraFrameMsgId, UpdateCameraFrame); _editorConnection.Register(ConnectionMessageIds.addFaceAnchorMsgeId, AddFaceAnchor); _editorConnection.Register(ConnectionMessageIds.updateFaceAnchorMsgeId, UpdateFaceAnchor); _editorConnection.Register(ConnectionMessageIds.removePlaneAnchorMsgeId, RemoveFaceAnchor); _editorConnection.Register(ConnectionMessageIds.screenCaptureYMsgId, ReceiveRemoteScreenYTex); _editorConnection.Register(ConnectionMessageIds.screenCaptureUVMsgId, ReceiveRemoteScreenUVTex); _savePath = Application.dataPath + "/" + _saveFilePath; _timeCount = 0; if (_recordingMode == RecordingMode.PLAYING) { _playingFileStream = new FileStream(_savePath, FileMode.Open, FileAccess.Read); _playingBinaryFormatter = new BinaryFormatter(); if (_playingFileStream.CanRead) { _nowFaceTrackingData = _playingBinaryFormatter.Deserialize(_playingFileStream) as FaceTrackingData; } _isStart = true; } }
// Use this for initialization void Start() { bTexturesInitialized = false; //put some defaults so that it doesnt complain UnityARCamera scamera = new UnityARCamera(); scamera.worldTransform = new UnityARMatrix4x4(new Vector4(1, 0, 0, 0), new Vector4(0, 1, 0, 0), new Vector4(0, 0, 1, 0), new Vector4(0, 0, 0, 1)); Matrix4x4 projMat = Matrix4x4.Perspective(60.0f, 1.33f, 0.1f, 30.0f); scamera.projectionMatrix = new UnityARMatrix4x4(projMat.GetColumn(0), projMat.GetColumn(1), projMat.GetColumn(2), projMat.GetColumn(3)); UnityARSessionNativeInterface.SetStaticCamera(scamera); editorConnection = EditorConnection.instance; editorConnection.Initialize(); editorConnection.RegisterConnection(PlayerConnected); editorConnection.RegisterDisconnection(PlayerDisconnected); editorConnection.Register(ConnectionMessageIds.updateCameraFrameMsgId, UpdateCameraFrame); editorConnection.Register(ConnectionMessageIds.addPlaneAnchorMsgeId, AddPlaneAnchor); editorConnection.Register(ConnectionMessageIds.updatePlaneAnchorMsgeId, UpdatePlaneAnchor); editorConnection.Register(ConnectionMessageIds.removePlaneAnchorMsgeId, RemovePlaneAnchor); editorConnection.Register(ConnectionMessageIds.screenCaptureYMsgId, ReceiveRemoteScreenYTex); editorConnection.Register(ConnectionMessageIds.screenCaptureUVMsgId, ReceiveRemoteScreenUVTex); }
private void SetupConnection() { // This forces a the connection to be reconstructed SetConnection(EditorConnection.instance); m_EditorConnection.Initialize(); m_EditorConnection.RegisterConnection(PlayerConnectedEventHandler); m_EditorConnection.RegisterDisconnection(PlayerDisconnectedEventHandler); // These EditorConnection callbacks can only be on UnityEngine.Objects // so register them here and just forward all messages to the ARRemoteEditorInterface m_EditorConnection.Register(ARMessageIds.frame, FrameMessageHandler); m_EditorConnection.Register(ARMessageIds.addPlane, PlaneAddedMessageHandler); m_EditorConnection.Register(ARMessageIds.updatePlane, PlaneUpdatedMessageHandler); m_EditorConnection.Register(ARMessageIds.removePlane, PlaneRemovedMessageHandler); m_EditorConnection.Register(ARMessageIds.screenCaptureY, ScreenCaptureYMessageHandler); m_EditorConnection.Register(ARMessageIds.screenCaptureUV, ScreenCaptureUVMessageHandler); m_EditorConnection.Register(ARMessageIds.screenCaptureParams, ScreenCaptureParamsMessageHandler); m_EditorConnection.Register(ARMessageIds.pointCloud, PointCloudMessageHandler); m_EditorConnection.Register(ARMessageIds.lightEstimate, LightEstimateMessageHandler); }
void Start() { bSessionActive = false; editorConnection = EditorConnection.instance; editorConnection.Initialize(); editorConnection.RegisterConnection(PlayerConnected); editorConnection.RegisterDisconnection(PlayerDisconnected); editorConnection.Register(MiraConnectionMessageIds.gyroMsgId, ReceiveRemoteGyroAttitude); editorConnection.Register(MiraConnectionMessageIds.wikiCamMsgId, ReceiveRemoteWikiCam); editorConnection.Register(MiraConnectionMessageIds.trackingFoundMsgId, TrackingFound); editorConnection.Register(MiraConnectionMessageIds.trackingLostMsgId, TrackingLost); editorConnection.Register(MiraConnectionMessageIds.BTRemoteMsgId, ReceiveBTRemote); editorConnection.Register(MiraConnectionMessageIds.BTRemoteButtonsMsgId, ReceiveBTRemoteButtons); editorConnection.Register(MiraConnectionMessageIds.BTRemoteTouchPadMsgId, ReceiveBTRemoteTouchPad); }
public void Register(Guid messageId, UnityAction <MessageEventArgs> callback) => m_Connection.Register(messageId, callback);