Esempio n. 1
0
        IEnumerator Start()
        {
            Screen.sleepTimeout = SleepTimeout.NeverSleep;

            if (processRequestsInMainThread)
            {
                Application.runInBackground = true;
            }
            server                = new WebServer(port, workerThreads, processRequestsInMainThread);
            server.logRequests    = logRequests;
            server.HandleRequest += HandleRequest;
            if (startOnAwake)
            {
                server.Start();
            }
            GameObject.Find("serveraddress").GetComponent <Text>().text = GetLocalIPAddress();
            GameObject.Find("status").GetComponent <Text>().text        = "Camera Filtering: " + filterSelected;
            GameObject.Find("status").GetComponent <Text>().color       = filterSelected ? Color.green : Color.yellow;

            if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                capture_ = new DepthCapture();
                yield return(Application.RequestUserAuthorization(UserAuthorization.WebCam));

                capture_.Configure(filter: filterSelected);
                capture_.Start();
            }
        }
    // Use this for initialization
    IEnumerator Start()
    {
        Debug.Log("Start");

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            capture_ = new DepthCapture();

            yield return(Application.RequestUserAuthorization(UserAuthorization.WebCam));

            capture_.Configure();
            capture_.Start();
        }
    }
Esempio n. 3
0
        private void changeFilterStatus(bool newStatus)
        {
            if (newStatus != filterSelected)
            {
                filterSelected = newStatus;

                if (Application.platform == RuntimePlatform.IPhonePlayer)
                {
                    capture_.Stop();
                    capture_.Dispose();
                    capture_ = new DepthCapture();
                    capture_.Configure(filter: filterSelected);
                    capture_.Start();
                }
                else
                {
                    System.Threading.Thread.Sleep(2000);
                }
                GameObject.Find("status").GetComponent <Text>().text  = "Camera Filtering: " + filterSelected;
                GameObject.Find("status").GetComponent <Text>().color = filterSelected ? Color.green : Color.yellow;
            }
        }