Esempio n. 1
0
    //    private void StopBrowser(WebViewTextureSample browser){
    //        browser.gameObject.renderer.enabled = false;
    //        browser.gameObject.collider.enabled = false;
    //        browser.moveSpeed = browserSpeed;
    //    }
    private IEnumerator FeedLinks()
    {
        bool movingFirst = true;
        LinkBrief nextLink;
        firstScreen = (GameObject)GameObject.Instantiate(screenPrefab, startPosition, startRotation);
        LoadUpBrowser(firstScreen, currentLinks[0]);

        for(int i = 1; i < currentLinks.Count-1; i++){
            nextLink = currentLinks[i];
            if (nextLink.nsfw){
                i++;
                if (i >= currentLinks.Count){break;}
                nextLink = currentLinks[i];
            }
            if (movingFirst){
                backScreen = (GameObject)GameObject.Instantiate(screenPrefab, startPosition, startRotation);
                LoadUpBrowser(backScreen, nextLink);
                currentBrowser = firstScreen.GetComponent<WebViewTextureSample>();
            } else {
                firstScreen = (GameObject)GameObject.Instantiate(screenPrefab, startPosition, startRotation);
                LoadUpBrowser(firstScreen, nextLink);
                currentBrowser = backScreen.GetComponent<WebViewTextureSample>();
            }
            StartScreenForward(currentBrowser);
            while(currentBrowser.animation.isPlaying){
                yield return new WaitForSeconds(Time.deltaTime);
            }
        //			StopBrowser(currentBrowser);
        //			currentBrowser.gameObject.transform.position = startPosition;
        //			currentBrowser.gameObject.transform.rotation = startRotation;
            Destroy(currentBrowser);
            movingFirst = !movingFirst;
        }
        //out of links!
    }
Esempio n. 2
0
 private void StartScreenForward(WebViewTextureSample browser)
 {
     browser.MakeVisible();
     browser.gameObject.animation.enabled = true;
     browser.gameObject.animation["screenForward"].speed = browserSpeed;
     browser.gameObject.animation.Play();
 }