BeginFade() public method

public BeginFade ( int direction ) : float
direction int
return float
Exemplo n.º 1
0
    public IEnumerator fadeIn()
    {
        Debug.Log("FadeIn");
        float fadeTime = fader.BeginFade(-1);

        yield return(new WaitForSeconds(fadeTime));
    }
Exemplo n.º 2
0
    private void Start()
    {
        Fade.BeginFade(-1);
        //yield return new WaitForSeconds(fadeTime);

        TotalDecisions = Responses.Count;
    }
Exemplo n.º 3
0
    public IEnumerator StartGame()
    {
        if (timeFromStartOfTheGame >= 27)
        {
            EnableSound();

            _FadeOutScriptPlayButton.FadeOutAndMakeNonInteractable(0.0f, 0.5f);
            alphaPlayBeforeFade = 0.0f;
            _FadeOutScriptOptions.FadeOutObject(0.33f, 1.0f);
            alphaOptionsBeforeFade = 0.33f;
            yield return(new WaitForSeconds(0.3f));

            _FadingToBlack.BeginFade(1);
            yield return(new WaitForSeconds(0.65f));

            x++;
            _FadeOutScriptTapTapImage.FadeInObject(1.0f, 1.0f);
            if (x == 1)
            {
                _Camera.MoveCameraInPlayPosition();
            }

            _FadingToBlack.BeginFade(-1);
            yield return(new WaitForSeconds(0.2f));

            numberOfButtonPresses++;
            MakeGameBeInAlmostPlayMode();

            yield return(null);
        }
    }
Exemplo n.º 4
0
 private void Start()
 {
     Fade.BeginFade(-1);
     if (!SoundManager.Instance.Looper.isPlaying)
     {
         SoundManager.Instance.PlayBackGround(0);
     }
 }
Exemplo n.º 5
0
    IEnumerator FadeAndLoadLevel(string name)
    {
        float time = fading.BeginFade(1);

        yield return(new WaitForSeconds(time));

        SceneManager.LoadScene(name);
    }
Exemplo n.º 6
0
    IEnumerator LoadLevel(string sceneName)
    {
        fadeTime = fading.BeginFade(Fading.FadeDirection.fadeOut);
        yield return(new WaitForSeconds(fadeTime));

        SceneManager.LoadScene(sceneName);
        Invoke("FadinAfterLoad", fadeTime / 2);
    }
    IEnumerator OpeningSequence()
    {
        float fadeTime = fadeObj.BeginFade(1, 10f);

        yield return(new WaitForSeconds(fadeTime));

        yield return(StartCoroutine(GameIntro()));
    }
Exemplo n.º 8
0
    IEnumerator ChangeScene(string sceneName)
    {
        float fadeTime = fadeController.BeginFade(1);

        yield return(new WaitForSeconds(fadeTime));

        SceneManager.LoadScene(sceneName, LoadSceneMode.Single);
    }
Exemplo n.º 9
0
    IEnumerator GoToScene(string name)
    {
        Debug.Log("FadeOut");
        float fadeTime = fader.BeginFade(1);

        yield return(new WaitForSeconds(fadeTime));

        SceneManager.LoadScene(name, LoadSceneMode.Single);
    }
Exemplo n.º 10
0
    IEnumerator ChangeLevel()
    {
        yield return(new WaitForSeconds(0.5f));

        float fadeTime = _fading.BeginFade(1);

        yield return(new WaitForSeconds(fadeTime));

        Application.LoadLevel(0);
    }
Exemplo n.º 11
0
    public void loadScene()
    {
        source.PlayOneShot(audio1, volume1);
        float fadeTime = fading.BeginFade(1);

        //yield return new WaitForSeconds(fadeTime);
        loadingScreen.GetComponent <loadingScreen>().levelToLoad  = scene;
        loadingScreen.GetComponent <loadingScreen>().startLoading = true;
        source.PlayOneShot(audio2, volume2);
    }
    // Sets up a single frame
    void SetUpCurrentFrame()
    {
        // make sure there is no invalid frame data
        string check   = ExceptionChecker();
        bool   invalid = check.Equals("") ? false : true; // if the check returns an empty string, then there are no errors in the json

        if (invalid)
        {
            Debug.Log("Invalid data found in json file.");
            Debug.Log(check);
            return;
        }

        // empty the strings for any texts currently in the scene
        foreach (CutsceneTextObject cto in textHandlers)
        {
            cto.SetTextToBlank();
        }

        // set the sprite and its color
        background.sprite = Resources.Load <Sprite>("CutsceneImages/" + allFrames[frameCount].imageName);
        background.color  = new Color(allFrames[frameCount].imageColor[0], allFrames[frameCount].imageColor[1], allFrames[frameCount].imageColor[2], allFrames[frameCount].imageColor[3]);

        batchStep = 0;  // reset batchStep to 0

        // reset batch and text lists
        activeTextBatches = new Queue <CutsceneTextBatchData>();
        activeTextData    = new Queue <CutsceneTextData>();

        // add in all batches in the frame to the activeTextBatch queue
        foreach (CutsceneTextBatchData ctbd in allFrames[frameCount].cutsceneTextBatchDatas)
        {
            activeTextBatches.Enqueue(ctbd);
        }

        currentBatch = activeTextBatches.Dequeue(); // set the current batch we will view

        // set up the activeTextData queue that we'll read sentences off of from the current batch
        for (int i = 0; i < currentBatch.cutsceneTextDatas.Length; i++)
        {
            activeTextData.Enqueue(currentBatch.cutsceneTextDatas[i]);
        }

        fadeSpeed = allFrames[frameCount].fadeSpeeds[0]; // set fade in speed for the frame

        fader.BeginFade(-1, fadeSpeed);                  // fade in (hence the -1) at the given speed in the data
        StartCoroutine(WaitFade(true, 0));               // wait for the fade in to finish
    }
Exemplo n.º 13
0
    IEnumerator LoadNextScene()
    {
        fade.BeginFade(1);
        yield return(new WaitForSeconds(2f));

        SceneManager.LoadScene(levelToLoad, LoadSceneMode.Single);
    }
Exemplo n.º 14
0
    private IEnumerator SwitchScene()
    {
        GameObject[] words = GameObject.FindGameObjectsWithTag("Word");
        foreach (GameObject word in words)
        {
            word.GetComponent <WordController>().speed = -10.0f;
            //Destroy(word);
        }
        float timeElapsed = 0.0f;

        while (timeElapsed < 5.0f)
        {
            if (victory)
            {
                halo.transform.localScale = new Vector3(halo.transform.localScale.x + 8 * Time.deltaTime, halo.transform.localScale.y + 8 * Time.deltaTime, 1);
            }
            timeElapsed += Time.deltaTime;
            if (timeElapsed > 3.0f && 3.3f > timeElapsed)
            {
                fade.BeginFade(1);
            }
            yield return(new WaitForSeconds(0));
        }
        //yield return new WaitForSeconds(5.0f);
        SceneManager.LoadScene("Nirvana", LoadSceneMode.Single);
    }
Exemplo n.º 15
0
    IEnumerator StartLevelChange()
    {
        _fader.BeginFade(fadeLevelOut);
        yield return(new WaitForSeconds(fadeLevelOut));

        SceneManager.LoadScene("Game");
    }
Exemplo n.º 16
0
    public void RespawnPlayer()
    {
        Inventory.LoseALife();
        if (checkGameOver())
        {
            //game over logic
            SceneManager.LoadScene("LT1");
            return;
        }

        player.transform.position = currentCheckpoint.transform.position;

        player.transform.position = new Vector3(
            currentCheckpoint.transform.position.x,
            currentCheckpoint.transform.position.y - 0.35f,
            player.transform.position.z);

        player.GetComponent <PlayerDamageManager> ().Heal(99);
        player.GetComponent <PlayerDamageManager> ().BecomeInvincible();

        HealAllEnemies();
        RespawnRespawnables();
        ResetMovables();

        fader.BeginFade(-1);
    }
Exemplo n.º 17
0
    IEnumerator waitAndRestartScene()
    {
        Fading.BeginFade(1);
        yield return(new WaitForSeconds(1));

        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
    }
Exemplo n.º 18
0
    IEnumerator waitAndLoadScene()
    {
        Fading.BeginFade(1);
        yield return(new WaitForSeconds(1));

        SceneManager.LoadScene("scene" + "1");
        SceneManager.UnloadSceneAsync(SceneManager.GetActiveScene());
    }
Exemplo n.º 19
0
 // Use this for initialization
 void Start()
 {
     fadeScript = FindObjectOfType <Fading>();
     if (fadeScript)
     {
         fadeScript.BeginFade(-1);
     }
 }
Exemplo n.º 20
0
    public void NewScene(string scene)
    {
        float fadeTime = fading.BeginFade(1);

        //yield return new WaitForSeconds(fadeTime);
        loadingScreen.GetComponent <loadingScreen>().levelToLoad   = scene;
        loadingScreen.GetComponent <loadingScreen> ().startLoading = true;
    }
Exemplo n.º 21
0
    IEnumerator ChangeLevel(int index)
    {
        GamePad.SetVibration(0, 0.0f, 0.0f);
        float fadeTime = fade.BeginFade(1);

        yield return(new WaitForSeconds(fadeTime));

        SceneManager.LoadScene(index);
    }
Exemplo n.º 22
0
 public void beginFade()
 {
     if (!fadeBegun)
     {
         fadeBegun = true;
         Fading fade = GetComponent <Fading>();
         fade.BeginFade(1);
     }
 }
Exemplo n.º 23
0
    IEnumerator TransitionNextScene()
    {
        fade.BeginFade(1);

        yield return(new WaitForSeconds(0.5f));

        izanagiShore.SetActive(true);
        scene01.SetActive(false);
        textCanvasObject.SetActive(false);

        yield return(new WaitForSeconds(0.5f));

        fade.BeginFade(-1);

        yield return(new WaitForSeconds(5f));

        ls.LoadScene("DnD_Hiragana");
    }
Exemplo n.º 24
0
    IEnumerator ChangeLevel()
    {
        yield return(new WaitForSeconds(0.5f));

        float fadeTime = _fade.BeginFade(1);

        yield return(new WaitForSeconds(fadeTime));

        SceneManager.LoadScene(1);
    }
Exemplo n.º 25
0
    public void Start()
    {
        // keep this object alive

        DontDestroyOnLoad(gameObject);

        fading = FindObjectOfType <Fading>();
        fading.BeginFade(Fading.FadeDirection.fadeIn);
        Invoke("DelayToMainMenu", 1.5f);
    }
Exemplo n.º 26
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "Player")
     {
         fading_go.BeginFade(1);
         GetComponent <Animation>().Play("end_anim_test_1");
         col.gameObject.GetComponent <Animation>().Play("end_anim_test_1");
         StartCoroutine(WaitAndLoad());
     }
 }
Exemplo n.º 27
0
    public void Credits()
    {
        Fading fader = GameObject.Find("SceneTransition").GetComponent <Fading>();

        if (fader != null)
        {
            fader.BeginFade(1);
        }
        StartCoroutine(LoadLevel("Credits", 1f));
    }
Exemplo n.º 28
0
    IEnumerator ChangeLevel()
    {
        yield return(new WaitForSeconds(0.5f));

        float fadeTime = _fadeScript.BeginFade(1);

        yield return(new WaitForSeconds(fadeTime));

        async.allowSceneActivation = true;
    }
    IEnumerator ChangeLevel()
    {
        yield return(new WaitForSeconds(0.5f));

        float fadeTime = _fadeScript.BeginFade(1);

        yield return(new WaitForSeconds(fadeTime));

        SceneManager.LoadScene("Alice_DigitalBook");
    }
Exemplo n.º 30
0
    private void OnTriggerEnter(Collider other)
    {
        Debug.Log("Demo ending shortly");
        m_doorTrigger.DisableTrigger();
        m_fading.ResetFade();
        m_fading.SetFade(true);
        float _fadeTime = m_fading.BeginFade(1);

        Invoke("EndGame", _fadeTime + 4.0f);
    }