Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (trans != null)
     {
         trans.position += new Vector3(-speed, 0, 0);
     }
     if (Input.GetKeyDown(KeyCode.Escape) || pass)
     {
         CameraEffectChange.ChangeEffect(1);
         Begin.pass = false;
         StopAllCoroutines();
         标题.isStart = true;
         SceneManager.LoadScene("标题界面", LoadSceneMode.Additive);
         AudioSystem.current.BGMSource.Stop();
         AudioSystem.ChangeBGM("BGM1", 1);
         SceneManager.UnloadSceneAsync("片头");
         MouseIcon.Change(1);
     }
 }
Beispiel #2
0
 static public void Change(string tounload, string toload, string sub = "", float delaytime = 0.4f, string bgm = "", float delay = 0, bool loop = true, int effectIndex = -1)
 {
     if (!isChanging)
     {
         if (effectIndex != -1)
         {
             CameraEffectChange.ChangeEffect(effectIndex);
         }
         if (bgm != "")
         {
             AudioSystem.ChangeBGM(bgm, delay + 2f, loop);
         }
         toUnload  = tounload;
         toLoad    = toload;
         Sub       = sub;
         delayTime = delaytime;
         if (delayTime < 0.1f)
         {
             delayTime = 0.4f;
         }
         SceneManager.LoadScene("过渡场景", LoadSceneMode.Additive);
         isChanging = true;
     }
 }
Beispiel #3
0
    IEnumerator begin()
    {
        MenuButtom.On  = false;
        Cursor.visible = false;
        MouseIcon.Change(0);
        CameraEffectChange.ChangeEffect(0);
        GameObject.FindGameObjectWithTag("button").GetComponent <SpriteRenderer>().enabled = false;
        Fade.Hide(logo);
        yield return(new WaitForSeconds(1f));

        Fade.FadeIn(logo, 1f);
        yield return(new WaitForSeconds(4f));

        Fade.Disappear(background, 3);
        yield return(new WaitForSeconds(3f));

        Fade.Disappear(logo, 3);
        yield return(new WaitForSeconds(3f));



        AudioSystem.ChangeBGM("BGM0", 0, false);
        CameraEffectChange.ChangeEffect(1);
        float t = 2.725f;

        yield return(Words1());//第一句话

        yield return(new WaitForSeconds(9.24f));

        yield return(flash.flash1()); //闪烁

        sky.SetActive(true);          //天空
        Fade.FadeIn(sky, 1f);
        yield return(new WaitForSeconds(2.05f));

        Fade.FadeOut(sky, 2);//天空消失
        yield return(new WaitForSeconds(3));

        yield return(Words2());

        yield return(new WaitForSeconds(5.5f));

        SceneManager.LoadScene("PlayerScene", LoadSceneMode.Additive);
        titleScene1.SetActive(true);
        Fade.FadeIn(titleScene1);
        放动画.isMove = true;
        trans      = titleScene1.transform;
        yield return(new WaitForSeconds(t));

        Fade.Disappear(titleScene1);
        titleScene2.SetActive(true);
        Fade.FadeIn(titleScene2);
        trans = titleScene2.transform;
        yield return(new WaitForSeconds(t));

        Fade.Disappear(titleScene2);
        titleScene3.SetActive(true);
        Fade.FadeIn(titleScene3);
        trans = titleScene3.transform;
        yield return(new WaitForSeconds(t));

        Fade.Disappear(titleScene3);
        titleScene4.SetActive(true);
        Fade.FadeIn(titleScene4);
        trans = titleScene4.transform;
        yield return(new WaitForSeconds(t));

        Fade.Disappear(titleScene4);
        titleScene5.SetActive(true);
        Fade.FadeIn(titleScene5);
        trans = titleScene5.transform;
        yield return(new WaitForSeconds(t));

        Fade.Disappear(titleScene5);
        titleScene6.SetActive(true);
        Fade.FadeIn(titleScene6);
        trans = titleScene6.transform;
        yield return(new WaitForSeconds(t));

        Fade.Disappear(titleScene6);
        titleScene7.SetActive(true);
        Fade.FadeIn(titleScene7);
        trans = titleScene7.transform;
        yield return(new WaitForSeconds(t));

        放动画.isMove = false;
        Fade.FadeOut(titleScene7, 1);
        Fade.FadeOut(Player.current.gameObject, 1);
        yield return(new WaitForSeconds(2));

        SceneManager.UnloadSceneAsync("PlayerScene");
        titleScene7.SetActive(false);
        yield return(Words3());

        yield return(new WaitForSeconds(3));

        yield return(Words4());

        yield return(new WaitForSeconds(7));

        标题.isStart = true;
        SceneManager.LoadScene("标题界面", LoadSceneMode.Additive);
        AudioSystem.ChangeBGM("BGM1", 7);
        SceneManager.UnloadSceneAsync("片头");
        MouseIcon.Change(1);
        MenuButtom.On = true;
    }