Ejemplo n.º 1
0
        /// <summary>
        /// Unity onEnable callback for the detector component
        /// </summary>
        public void OnEnable()
        {
            if (!AffdexUnityUtils.ValidPlatform())
            {
                return;
            }

            StartCoroutine(ListenForEvents());
        }
Ejemplo n.º 2
0
        void OnEnable()
        {
            if (!AffdexUnityUtils.ValidPlatform())
            {
                return;
            }

            if (sampleRate > 0)
            {
                StartCoroutine(SampleRoutine());
            }
        }
Ejemplo n.º 3
0
        void OnEnable()
        {
            if (!AffdexUnityUtils.ValidPlatform())
            {
                return;
            }

            //get the selected camera!

            if (sampleRate > 0)
            {
                StartCoroutine(SampleRoutine());
            }
        }
Ejemplo n.º 4
0
        //start called via unity
        public void Start()
        {
            if (!AffdexUnityUtils.ValidPlatform())
            {
                return;
            }

            if (startOnWake)
            {
                try
                {
                    StartDetector();
                }
                catch (Exception e)
                {
                    Debug.Log("Detector.Start: caught " + e.Message + " " + e.StackTrace);
                }
            }
        }
Ejemplo n.º 5
0
        void Start()
        {
            if (!AffdexUnityUtils.ValidPlatform())
            {
                return;
            }
            detector = GetComponent <Detector>();
#if !UNITY_XBOXONE && UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IOS || UNITY_ANDROID
            devices = WebCamTexture.devices;
            if (devices.Length > 0)
            {
                Debug.Log(isFrontFacing);
                SelectCamera(isFrontFacing);

                if (device.name != "Null")
                {
                    cameraTexture = new WebCamTexture(device.name, targetWidth, targetHeight, (int)sampleRate);
                    cameraTexture.Play();
                }
            }
#endif
        }