Esempio n. 1
0
    // スタート時に呼ばれる
    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;
        }
    }
Esempio n. 2
0
        // 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);
        }
Esempio n. 3
0
 private void OnEnable()
 {
     editorConnection = EditorConnection.instance;
     editorConnection.Initialize();
     editorConnection.RegisterConnection(OnPlayerConnected);
     editorConnection.RegisterDisconnection(OnPlayerDisconnected);
     editorConnection.Register(EditorConnectionMessageID.Player, OnPlayerMessageReceived);
     PlayerConnectorAttribute.Connect(this);
 }
 // 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);
 }
        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);
        }
Esempio n. 6
0
        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 OnEnable()
 {
     m_EditorConnection = EditorConnection.instance;
     m_EditorConnection.RegisterConnection(OnPlayerConnected);
     m_EditorConnection.RegisterDisconnection(OnPlayerDisconnected);
 }
 public void RegisterDisconnection(UnityAction <int> callback) => m_Connection.RegisterDisconnection(callback);