private void Start() { StartCoroutine(_cloudVrClient.LoadContentsList(this, (contents) => { if (contents == null) { Debug.Log("No content exists."); return; } _title.text = contents[0].title; _description.text = contents[0].description; StartCoroutine(contents[0].LoadThumbnail(this, 0, (index, thumbnail) => { _thumbnail.texture = thumbnail; }, (errorCode, error) => { Debug.Log(string.Format("LoadThumbnail failed : {0} : {1}", errorCode.ToString(), error)); })); for (int i = 0; i < Mathf.Min(_screenshots.Length, contents[0].screenshots.Length); i++) { StartCoroutine(contents[0].LoadScreenshot(this, i, (index, screenshot) => { _screenshots[index].texture = screenshot; }, (errorCode, error) => { Debug.Log(string.Format("LoadScreenshot {3} failed : {0} : {1}", errorCode.ToString(), error, i)); })); } }, (errorCode, error) => { Debug.Log(string.Format("LoadContentsList failed : {0} : {1}", errorCode.ToString(), error)); } )); StartCoroutine(_cloudVrClient.GetTrackers(this, (trackers) => { foreach (var tracker in trackers) { Debug.Log(string.Format("Tracker : {0} : {1}", tracker.userID, tracker.trackerID)); } }, (errorCode, error) => { Debug.Log(string.Format("GetTrackers failed : {0} : {1}", errorCode.ToString(), error)); } )); }
private void Start() { StartCoroutine(_cloudVrClient.LoadContentsList(this, (contents) => { if (contents == null) { Debug.Log("No content exists."); return; } _title.text = contents[0].title; _description.text = contents[0].description; StartCoroutine(contents[0].LoadThumbnail(this, 0, (index, thumbnail) => { _thumbnail.texture = thumbnail; }, (errorCode, error) => { Debug.Log(string.Format("LoadThumbnail failed : {0} : {1}", errorCode.ToString(), error)); })); for (int i = 0; i < Mathf.Min(_screenshots.Length, contents[0].screenshots.Length); i++) { StartCoroutine(contents[0].LoadScreenshot(this, i, (index, screenshot) => { _screenshots[index].texture = screenshot; }, (errorCode, error) => { Debug.Log(string.Format("LoadScreenshot {3} failed : {0} : {1}", errorCode.ToString(), error, i)); })); } StartCoroutine(contents[0].RequestLinkage(this, (linkage) => { Debug.Log(string.Format("Linkage created : {0}:{1}", linkage.host, linkage.port.ToString())); }, (errorCode, error) => { Debug.Log(string.Format("Linkage creation failed : {0} : {1}", errorCode.ToString(), error)); })); }, (errorCode, error) => { Debug.Log(string.Format("LoadContentsList failed : {0} : {1}", errorCode.ToString(), error)); } )); }