Ejemplo n.º 1
0
    //fade the screen and load the given level
    IEnumerator FadeAndExit(int i)
    {
        fader.FadeToBlack();
        yield return(new WaitForSeconds(2f));

        Application.LoadLevel(i);
    }
Ejemplo n.º 2
0
    IEnumerator CoSplashScreen()
    {
        fadeScreen.FadeToBlack();
        ClearScreen();
        cameraman.backgroundColor = Color.white;
        yield return(yieldInstruction03);

        TurnOn(splashScreen.gameObject);
        fadeScreen.FadeToClear();

        yield return(new WaitForSeconds(2f));

        PressStartScreen();
    }
Ejemplo n.º 3
0
 void FadeOut()
 {
     if (screenFader != null)
     {
         screenFader.FadeToBlack();
     }
 }
Ejemplo n.º 4
0
    IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        if (!isLocked)
        {
            if (other.gameObject.tag == "Player")
            {
                gameObject.GetComponents <AudioSource>()[0].Play();
                ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader> ();

                yield return(StartCoroutine(sf.FadeToBlack()));

                if (fairy != null)
                {
                    fairy.gameObject.transform.position = new Vector2(warpTarget.transform.position.x + xOffset, warpTarget.transform.position.y + yOffset);
                }

                other.gameObject.transform.position = new Vector2(warpTarget.transform.position.x + xOffset, warpTarget.transform.position.y + yOffset);

                yield return(StartCoroutine(sf.FadeToClear()));

                other.gameObject.GetComponent <PlayerController>().currRoom = toRoom;
            }
            if (bossRoom)
            {
                for (int i = 0; i < activators.Length; i++)
                {
                    activators[i].SetActive(!activators[i].activeSelf);
                }
                other.gameObject.GetComponent <PlayerController>().GeneralMusic = activators[2];
            }
        }
    }
Ejemplo n.º 5
0
    IEnumerator Restart()
    {
        ScreenFader.FadeToBlack(4);
        yield return(new WaitForSeconds(4));

        Application.LoadLevel(Application.loadedLevel);
    }
Ejemplo n.º 6
0
    private IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.name == "Player")
        {
            AudioManager aud = GameObject.FindGameObjectWithTag("Audio").GetComponent <AudioManager>();

            ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>();

            yield return(StartCoroutine(sf.FadeToBlack()));

            if (aud.isSibylAlive)
            {
                if (aud.isBasilMad)
                {
                    SceneManager.LoadScene("EndSibyl");
                }
                else
                {
                    SceneManager.LoadScene("EndSibylBasil");
                }
            }
            else
            {
                if (aud.isBasilMad)
                {
                    SceneManager.LoadScene("EndGood");
                }
                else
                {
                    SceneManager.LoadScene("EndBasil");
                }
            }
        }
    }
Ejemplo n.º 7
0
    // AnandaCoord = Warp.Location; set in app

    IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Player")
        {
            // Stops the player's movement
            playerAnim.SetBool("bIsWalking", false);
            player.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0);
            player.bStopPlayerMovement = true;
            touches.UnpressedAllArrows();

            // Fade out
            StartCoroutine(sFader.FadeToBlack());

            yield return(new WaitForSeconds(1.0f));

            cFollow.currentCoords = (CameraFollow.AnandaCoords)AnandaCoord;
            other.gameObject.transform.position = warpTarget.position;
            Camera.main.transform.position      = warpTarget.position;

            // Fade in
            StartCoroutine(sFader.FadeToClear());

            yield return(new WaitForSeconds(1.0f));

            if (areaAni)
            {
                areaAni.CheckAreaToAnimate();
            }

            player.bStopPlayerMovement = false;
        }
    }
Ejemplo n.º 8
0
    //Concertar amanhã!!
    IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        print("voce entrou!");
        infinito = true;
        while (infinito == true)
        {
            if (infinito == false)
            {
                break;
            }
            yield return(new WaitForSeconds(0.5f));

            random = Random.Range(0, 100);
            if (random <= 4)
            {
                gatilhoParaBatalha.GetComponent <GatilhoCompartilhado> ().falaTrigger = true;                //jogador fica parado

                // transição para batalha
                ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader> ();

                yield return(StartCoroutine(sf.FadeToBlack()));

                batalha.SetActive(true);
                gatilhoParaBatalha.GetComponent <GatilhoCompartilhado> ().battleTrigger = true;

                yield return(StartCoroutine(sf.FadeToClear()));

                while (gatilhoParaBatalha.GetComponent <GatilhoCompartilhado> ().fechou == false)
                {
                    yield return(new WaitForSeconds(0.5f));
                }
            }
        }
    }
Ejemplo n.º 9
0
    IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        Debug.Log("fading out!!!");

        GameObject gobj = GameObject.FindGameObjectWithTag("ScreenFader");

        if (gobj == null)
        {
            Debug.Log("no gameobject tagged");
        }
        ScreenFader sf = gobj.GetComponent <ScreenFader> ();

        if (sf == null)
        {
            Debug.Log("no screen fader found by tag");
        }

        yield return(StartCoroutine(sf.FadeToBlack()));

        other.gameObject.transform.position = warpTarget.position;
        Camera.main.transform.position      = warpTarget.position;

        Debug.Log("fading in !!!");
        yield return(StartCoroutine(sf.FadeToClear()));

        Debug.Log("Transition complete.");
    }
Ejemplo n.º 10
0
    public Transform warpTarget;     // Transform


    IEnumerator OnTriggerEnter2D(Collider2D other)    //other
    {
        Debug.Log("An object collided.");

        ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>();

        Debug.Log("fade out");

        // yield return StartCoroutine(sf.FadeToBlack());

        Debug.Log("player position");
        if (other.gameObject.name == "Player")              //
        {
            yield return(StartCoroutine(sf.FadeToBlack())); //

            other.gameObject.transform.position = warpTarget.position;
            Camera.main.transform.position      = warpTarget.position;
            yield return(StartCoroutine(sf.FadeToClear())); //
        }

        /* if (player.gameObject.name == "Player") // new warp?
         * {
         *  // ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent<ScreenFader>();
         *   player.gameObject.transform.position = warpTarget.position;
         *   Camera.main.transform.position = warpTarget.position;
         *   yield return StartCoroutine(sf.FadeToBlack());
         *
         *
         *   yield return StartCoroutine(sf.FadeToClear());
         * }*/

        // yield return StartCoroutine (sf.FadeToClear());

        Debug.Log("fade in");
    }
Ejemplo n.º 11
0
    IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        Debug.Log("An object collided");

        //Screen fader
        ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader> ();

        Debug.Log("Pre fade out");

        //Tentative de pause
        //Time.timeScale = 0f;

        //Première animation du fondu d'écran
        yield return(StartCoroutine(sf.FadeToBlack()));

        //Le joueur se déplace jusqu'à la nouvelle cible
        Debug.Log("Update player position");

        if (other.gameObject.tag == "Player")
        {
            other.gameObject.transform.position = warpTarget.position;
            Camera.main.transform.position      = warpTarget.position;
        }

        //Dernière animation du fondu d'écran
        yield return(StartCoroutine(sf.FadeToClear()));

        //Tentative de dépausage
        //Time.timeScale = 1f;

        Debug.Log("Fade in complete");
    }
Ejemplo n.º 12
0
    IEnumerator warptotarget()
    {
        Debug.Log("WARPING");
        istriggered = false;
        load        = false;
        load2       = false;

        ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>();


        yield return(StartCoroutine(sf.FadeToBlack()));

        dMan.background.gameObject.SetActive(false);
        thePlayer.gameObject.transform.position = pwarptarget.position;

        thePlayer.anim.SetFloat("LastMoveX", 0f);
        thePlayer.anim.SetFloat("LastMoveY", 1f);

        yield return(StartCoroutine(sf.FadeToClear()));

        istriggered = false;

        load  = false;
        load2 = false;
        qmp.questCompleted();
    }
    public void Fade()
    {
        GameObject  go = GameObject.FindGameObjectWithTag("Fader");
        ScreenFader sf = go.GetComponent <ScreenFader> ();

        sf.FadeToBlack();
        SceneManager.LoadScene(SaveLoad.recentState.lastScene);
    }
Ejemplo n.º 14
0
    IEnumerator TutorialRoutine()
    {
        yield return(null);

        tutorialText.text = "Welcome to the tutorial.";
        yield return(new WaitForSeconds(5f));

        tutorialText.text = "The goal of this game is to build the largest town possible within the time limit";
        yield return(new WaitForSeconds(5f));

        tutorialText.text = "The more people living in your town, the higher your score.";
        yield return(new WaitForSeconds(5f));

        tutorialText.text = "First, let's show you how to rotate the world.";
        Vector3 cachedAngle = world.transform.eulerAngles;

        yield return(new WaitForSeconds(5f));

        tutorialText.text = "Hold the A button on your controller, and move your hand.";
        yield return(new WaitUntil(() => cachedAngle != world.transform.eulerAngles));

        tutorialText.text = "Nice work!";
        yield return(new WaitForSeconds(5f));

        tutorialText.text = "Now let's place some buildings.";
        yield return(new WaitForSeconds(5f));

        buildingStuff.SetActive(true);
        tutorialText.text = "You can grab buildings from the right side.";
        yield return(new WaitForSeconds(5f));

        tutorialText.text = "Try doing this now.";
        yield return(new WaitUntil(() => cg.buildingPrefab != null));

        tutorialText.text = "Nice!";
        yield return(new WaitForSeconds(5f));

        tutorialText.text = "You can place buildings by aiming at the surface of the world, and squeezing the trigger.";
        yield return(new WaitForSeconds(5f));

        tutorialText.text = "Buildings cost resources, but award them too.";
        yield return(new WaitForSeconds(5f));

        tutorialText.text = "Buildings can't be placed anywhere. Consult the panel for more info.";
        yield return(new WaitForSeconds(5f));

        tutorialText.text = "This concludes the tutorial. Have a nice day :)";
        yield return(new WaitForSeconds(5f));

        StartCoroutine(screenFader.FadeToBlack());
        yield return(new WaitForSeconds(1f));

        SceneManager.LoadScene("MainMenu");
        //yield return new WaitForSeconds(5f);
        //tutorialText.text = "You can grab buildings from the right side.";
        //yield return new WaitForSeconds(5f);
        //tutorialText.text = "You can grab buildings from the right side.";
    }
Ejemplo n.º 15
0
    IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        aMan.AreaCode = AreaNumber;
        Warping       = true;
        Debug.Log("Warp2");
        ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>();

        yield return(StartCoroutine(sf.FadeToBlack()));

        other.gameObject.transform.position = warpTarget.position;
        Camera.main.transform.position      = warpTarget.position;
        yield return(StartCoroutine(sf.FadeToClear()));

        Warping = false;
        Debug.Log("Warp3");



        if (other.gameObject.name == "Male1" && inRange == false == false)
        {
            /*            if (gameObject.CompareTag("W0"))
             *          {
             *              AreaNumber = 0;
             *          }
             *          if (gameObject.CompareTag("W1"))
             *          {
             *              AreaNumber = 1;
             *          }
             *          if (gameObject.CompareTag("W2"))
             *          {
             *              AreaNumber = 2;
             *          }
             *          if (gameObject.CompareTag("W3"))
             *          {
             *              AreaNumber = 3;
             *          }
             *          if (gameObject.CompareTag("W4"))
             *          {
             *              AreaNumber = 4;
             *          }
             *          if (gameObject.CompareTag("W5"))
             *          {
             *              AreaNumber = 5;
             *          }
             *          if (gameObject.CompareTag("W6"))
             *          {
             *              AreaNumber = 5;
             *          }
             *          if (gameObject.CompareTag("W7"))
             *          {
             *              AreaNumber = 7;
             *          }*/

            inRange       = true;
            aMan.AreaCode = 4;
            aMan.AreaCode = AreaNumber;
        }
    }
Ejemplo n.º 16
0
 void Update()
 {
     if (OVRInput.Get(OVRInput.Axis1D.SecondaryHandTrigger, OVRInput.Controller.Touch) > 0 && primed && !triggered)
     {
         triggered = true;
         StartCoroutine(screenFader.FadeToBlack());
         StartCoroutine(ChangeScene());
     }
 }
Ejemplo n.º 17
0
    IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>();

        yield return(StartCoroutine(sf.FadeToBlack()));

        SceneManager.LoadScene(sceneName: SceneName);
        yield return(StartCoroutine(sf.FadeToClear()));
    }
Ejemplo n.º 18
0
    IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>();

        yield return(StartCoroutine(sf.FadeToBlack()));

        other.gameObject.transform.position = warpTarget.position;
        Camera.main.transform.position      = warpTarget.position;
        yield return(StartCoroutine(sf.FadeToClear()));
    }
Ejemplo n.º 19
0
 // this is the method that is run when the main menu button is pressed
 public void MainMenu()
 {
     // if the screen fader hasn't started fading yet
     if (fadeToMenu == false)
     {
         // start fading to black and set the reserved boolean
         screenFader.FadeToBlack(1f);
         fadeToMenu = true;
     }
 }
Ejemplo n.º 20
0
    public IEnumerator nextScene(string SceneName)
    {
        isRunning = true;
        ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>();

        yield return(StartCoroutine(sf.FadeToBlack()));

        SceneManager.LoadScene(SceneName);
        isRunning = false;
    }
Ejemplo n.º 21
0
    IEnumerator OnTriggerEnter2D(Collider2D col)
    {
        sf = GameObject.FindGameObjectWithTag ("Fader").GetComponent<ScreenFader> ();

        player.StopPlayer ();
        yield return StartCoroutine(sf.FadeToBlack ());
        player.StopPlayer ();
        col.gameObject.transform.position = warpTarget.transform.position;
        Camera.main.transform.position = warpTarget.transform.position;
        yield return StartCoroutine(sf.FadeToClear ());
    }
Ejemplo n.º 22
0
    public IEnumerator Wait(Collider2D other)
    {
        yield return(new WaitForSeconds(0.1f));

        SaveLoad.SaveState();
        Debug.Log("Saved");
        GameObject  go = GameObject.FindGameObjectWithTag("Fader");
        ScreenFader sf = go.GetComponent <ScreenFader> ();

        sf.FadeToBlack();
        SceneManager.LoadScene(targetScene);
    }
    public IEnumerator Fade(Character other)
    {
        yield return(new WaitForSeconds(.1f));

        SaveLoad.SaveState();
        Debug.Log("Saved");
        GameObject  go = GameObject.FindGameObjectWithTag("Fader");
        ScreenFader sf = go.GetComponent <ScreenFader> ();

        sf.FadeToBlack();
        SceneManager.LoadScene("Battle test");
    }
Ejemplo n.º 24
0
    IEnumerator EndSquence()
    {
        highlight = false;
        HighlightSquare(1, 20, color1);
        GetComponent <AudioSource> ().volume = PlayerPrefs.GetFloat("effects");
        GetComponent <AudioSource> ().Play();
        playerInputController.DisableInput();
        screenFader.FadeToBlack();
        yield return(new WaitForSeconds(5));

        SceneManager.LoadScene("FrontDesk");
    }
Ejemplo n.º 25
0
    IEnumerator OnTriggerEnter2D(Collider2D collision)
    {
        ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>();

        yield return(StartCoroutine(sf.FadeToBlack()));

        if (collision.gameObject.name == "Player")
        {
            SceneManager.LoadScene(levelToLoad);
            yield return(StartCoroutine(sf.FadeToClear()));
        }
    }
Ejemplo n.º 26
0
    IEnumerator OnTriggerEnter2D(Collider2D target)
    //void OnTriggerEnter2D(Collider2D target)
    {
        if (target.transform.CompareTag("Player"))
        {
            if (locked)
            {
                if (hourInt < 18 && hourInt > 6)
                {
                    myPlayerMovement.HandleMovement(Vector2.zero);
                    myPlayerMovement.enabled = false;
                    if (myPlayerInventory.IsOpen)
                    {
                        myPlayerInventory.OpenCloseInventory();
                    }

                    ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>();

                    yield return(StartCoroutine(sf.FadeToBlack()));

                    target.gameObject.transform.position = warpTarget.position;
                    Camera.main.transform.position       = warpTarget.position;
                    yield return(StartCoroutine(sf.FadeToClear()));

                    myPlayerMovement.enabled = true;
                }
                else if (hourInt >= 18 || hourInt <= 6)
                {
                    textBox.SetActive(true);
                    typewriter.GetComponent <Examine>().RecieveText(examinedObject);
                }
            }
            else if (!locked)
            {
                myPlayerMovement.HandleMovement(Vector2.zero);
                myPlayerMovement.enabled = false;
                if (myPlayerInventory.IsOpen)
                {
                    myPlayerInventory.OpenCloseInventory();
                }

                ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>();

                yield return(StartCoroutine(sf.FadeToBlack()));

                target.gameObject.transform.position = warpTarget.position;
                Camera.main.transform.position       = warpTarget.position;
                yield return(StartCoroutine(sf.FadeToClear()));

                myPlayerMovement.enabled = true;
            }
        }
    }
    public Transform wrapTarget;     //get the position of object

//void OnTriggerEnter2D(Collider2D other){
    IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        if (other.name == "player")
        {
            ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader> ();
            yield return(StartCoroutine(sf.FadeToBlack()));

            other.gameObject.transform.position = wrapTarget.position;
            Camera.main.transform.position      = wrapTarget.position;
//Fade in and Fade out animation handler
            yield return(StartCoroutine(sf.FadeToClear()));
        }
    }
    public void SwitchLights(bool state)
    {
        ScreenFader fader = GetComponent <ScreenFader>();

        if (state)
        {
            fader.FadeFromBlack();
        }
        else
        {
            fader.FadeToBlack();
        }
    }
Ejemplo n.º 29
0
    public IEnumerator TitleOff()
    {
        ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>();

        yield return(new WaitForSeconds(turnOffTime));

        yield return(StartCoroutine(sf.FadeToBlack()));

        child.SetActive(false);
        yield return(StartCoroutine(sf.FadeToClear()));

        camera.GetComponent <AudioSource>().Play();
    }
Ejemplo n.º 30
0
    IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader> ();

        // Debug.Log ("An object.");
        if (other.gameObject.name == "Player")
        {
            yield return(StartCoroutine(sf.FadeToBlack()));

            other.gameObject.transform.position = warpTarget.position;

            yield return(StartCoroutine(sf.FadeToClear()));
        }
    }
Ejemplo n.º 31
0
    IEnumerator restoretownstate()
    {
        questCompleted();
        ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>();


        yield return(StartCoroutine(sf.FadeToBlack()));


        npCont.set1State(true);
        npCont.set2State(false);
        mc.switchTrack(1);
        yield return(StartCoroutine(sf.FadeToClear()));
    }
Ejemplo n.º 32
0
    IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        sf = GameObject.FindGameObjectWithTag("fader").GetComponent<ScreenFader>();

        if (other.gameObject.name == "Hero")
        {
            yield return StartCoroutine(sf.FadeToBlack());
            hero.transform.position = enter.position;
            Camera.main.transform.position = enter.position;
        }
        //Debug.Log("an object has warped");

        yield return StartCoroutine(sf.FadeToClear());
    }