Ejemplo n.º 1
0
        void OnEnable()
        {
            if (cameraAsParent == null)
            {
                Debug.LogWarning("Frame Publisher needs the camera transform");
                enabled = false;
                return;
            }

            if (subscriptionsController == null)
            {
                Debug.LogWarning("Frame Publisher needs access to SubscriptionsController");
                enabled = false;
                return;
            }


            if (publisher == null)
            {
                publisher = new FrameListener(subscriptionsController);
            }

            Debug.Log("Enabling Frame Visualizer");

            publisher.OnReceiveEyeFrame += ReceiveEyeFrame;

            eyePublishingInitialized = new bool[] { false, false };
        }
Ejemplo n.º 2
0
        void OnEnable()
        {
            if (cameraAsParent == null || subscriptionsController == null || eyeFrameMaterial == null)
            {
                Debug.LogWarning("Required components missing!");
                enabled = false;
                return;
            }

            if (Listener == null)
            {
                Listener = new FrameListener(subscriptionsController);
            }

            Debug.Log("Enabling Frame Visualizer");

            Listener.Enable();
            Listener.OnReceiveEyeFrame += ReceiveEyeFrame;

            eyePublishingInitialized = new bool[] { false, false };
        }
Ejemplo n.º 3
0
        void OnEnable()
        {
            bool allReferencesValid = true;

            if (cameraAsParent == null)
            {
                Debug.LogError("Camera reference 'cameraAsParent' missing!");
                allReferencesValid = false;
            }
            if (subscriptionsController == null)
            {
                Debug.LogError("SubscriptionsController reference missing!");
                allReferencesValid = false;
            }
            if (eyeFrameMaterial == null)
            {
                Debug.LogError("EyeFrameMaterial reference missing!");
                allReferencesValid = false;
            }
            if (!allReferencesValid)
            {
                Debug.LogError("FrameVisualizer is missing required references to other components. Please connect the references, or the component won't work correctly.");
                enabled = false;
                return;
            }

            if (Listener == null)
            {
                Listener = new FrameListener(subscriptionsController);
            }

            Debug.Log("Enabling Frame Visualizer");

            Listener.Enable();
            Listener.OnReceiveEyeFrame += ReceiveEyeFrame;

            eyePublishingInitialized = new bool[] { false, false };
        }