Ejemplo n.º 1
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.L))
        {
            StartCoroutine(_cloudVrClient.RequestGroupLinkage(this,
                                                              (linkage) => {
                Debug.Log(string.Format("Group Linkage : {0}:{1}", linkage.host, linkage.port));
            },
                                                              (errorCode, error) => {
                Debug.Log(string.Format("RequestGroupLinkage failed : {0} : {1}", errorCode.ToString(), error));
            }
                                                              ));
        }
        else if (Input.GetKeyDown(KeyCode.C))
        {
            if (_commandChannel.opened == false)
            {
                _commandChannel.Open();
                Debug.Log("CloudVR CommandChannel opened");
            }
            else
            {
                _commandChannel.Close();
                Debug.Log("CloudVR CommandChannel closed");
            }
        }

        _commandChannel.Update(Time.deltaTime);
    }
    public void Init(Configuration config)
    {
        if (config.cloudVRClient != null)
        {
            commandChannel = new CloudVRCommandChannel(config.cloudVRClient, "content");
            commandChannel.CommandReceived += onCloudVRCommandReceived;
            commandChannel.Open();
        }

        if (CircleVR.IsEditorPlatform())
        {
            CircleVRControlPannel.onCommand += controlPannelCommandReceived;
        }

        if (Event != null)
        {
            Event.OnInit();
        }

        Debug.Log("[CircleVR Content Server] Initialized");
    }