// handle CloudVR command events private void onCloudVRCommandReceived(CloudVRCommandChannel channel, string command) { CircleVRServerCommand cmd = JsonUtility.FromJson <CircleVRServerCommand>(command); Debug.Log("[CircleVR] Command received : " + cmd.type); OnCommand(cmd.type); }
// handle engine events private void Awake() { _title = transform.Find("Title").GetComponent <Text>(); _description = transform.Find("Description").GetComponent <Text>(); _thumbnail = transform.Find("Thumbnail").GetComponentInChildren <RawImage>(); _screenshots = transform.Find("Screenshots").GetComponentsInChildren <RawImage>(); _cloudVrClient = new CloudVRClient(_hostname, _port); _commandChannel = new CloudVRCommandChannel(_cloudVrClient, "content"); _commandChannel.CommandReceived += onCloudVRCommandReceived; }
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"); }
// handle CloudVRCommandChannel commands private void onCloudVRCommandReceived(CloudVRCommandChannel channel, string command) { Debug.Log("CloudVR Command received : " + command); }