コード例 #1
0
    private void WipeFadeOut()
    {
        SFX.Play("Screen_wipe", 1f, 1f, 0f, false, 0f);

        DOTween.To(() => bg.fillAmount, x => bg.fillAmount = x, 0f, .7f).SetUpdate(true).SetEase(Ease.InCubic)
        .OnComplete(() => Initiate.DoneFading());
    }
コード例 #2
0
 public void SkipAnimation()
 {
     print("Skip");
     if (_skipAnimation)
     {
         return;
     }
     _skipAnimation = true;
     Initiate.DoneFading();
     Initiate.Fade("Scenes/GameScene", Color.black, 0.8f);
 }
コード例 #3
0
ファイル: Fader.cs プロジェクト: FructueuxJefferson/Word-War
    IEnumerator FadeIt()
    {
        while (!start)
        {
            //waiting to start
            yield return(null);
        }
        lastTime = Time.time;
        float coDelta    = lastTime;
        bool  hasFadedIn = false;

        while (!hasFadedIn)
        {
            coDelta = Time.time - lastTime;
            if (!isFadeIn)
            {
                //Fade in
                alpha = newAlpha(coDelta, 1, alpha);
                if (alpha == 1 && !startedLoading)
                {
                    startedLoading = true;
                    SceneManager.LoadScene(fadeScene);
                }
            }
            else
            {
                //Fade out
                alpha = newAlpha(coDelta, 0, alpha);
                if (alpha == 0)
                {
                    hasFadedIn = true;
                }
            }
            lastTime       = Time.time;
            myCanvas.alpha = alpha;
            yield return(null);
        }

        Initiate.DoneFading();

        Debug.Log("Your scene has been loaded , and fading in has just ended");
        Debug.Log(fadeScene);
        if (fadeScene.Equals("Game"))
        {
        }

        Destroy(gameObject);

        yield return(null);
    }