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

            StartCoroutine(ListenForEvents());
        }
Example #2
0
        void OnEnable()
        {
            if (!AffdexUnityUtils.ValidPlatform())
            {
                return;
            }

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

            //get the selected camera!

            if (sampleRate > 0)
            {
                StartCoroutine(SampleRoutine());
            }
        }
Example #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);
                }
            }
        }
        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
        }