Пример #1
0
    //決定したシーンへ遷移する
    private void changeScene()
    {
        if (Input.GetButtonDown("AButton"))
        {
            if (SFade.ImageAlpha <= 0)
            {
                audio.Stop();
                audio.PlayOneShot(dicideSE, 1.0f);
                fade        = true;
                SFade.FFlag = true;
            }
        }

        if (fade)
        {
            //フェードイン
            SFade.FadeIn();

            if (SFade.ImageAlpha == 1)
            {
                switch (selectNum)
                {
                case 0:
                    SceneManager.LoadScene(SMana.Scenes("Select"));
                    break;

                case 1:
                    SceneManager.LoadScene(SMana.Scenes("Select"));
                    break;

                case 2:
                    fade        = false;
                    SFade.FFlag = false;
                    break;
                }

                //モード設定
                datums.Mode = selectNum;
            }
        }
    }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        //Debug.Log(rounds);

        //シーン開始時のフェードアウト
        if (disF)
        {
            fade.FadeOut();

            //フェードアウト終了
            if (fade.ImageAlpha <= 0 && !fade.FFlag)
            {
                //ラウンド表示&fight表示
                Round.RoundsDisplay(rounds);
                if (Round.AppearRound && Round.RoundAlpha(rounds) <= 0)
                {
                    Fight.FightDisplay();
                }

                if (!soundPlayed)
                {
                    audio.PlayOneShot(sounds[rounds], 1.0f);
                    soundPlayed = true;
                }

                //対戦が終了したら
                Finish.FinishVS();
            }
        }

        if (!Finish.GetF && disF)
        {
            //アイコン点灯
            GetGame.DisplayGame();
            disF = false;
        }

        if (!disF)
        {
            fade.FFlag = true;
            fade.FadeIn();

            if (fade.ImageAlpha >= 1)
            {
                //どちらかが2勝したらりざるとへ
                if (GetGame.P1win == 2 || GetGame.P2win == 2)
                {
                    for (int i = 0; i < intentions.Count; i++)
                    {
                        if (intentions[i].IsTrain)
                        {
                            loadCanvas.SetActive(true);
                            intentions[i].LearningSpeed = 5;
                            return;
                        }
                    }

                    loadCanvas.SetActive(false);
                    GetGame.ResetGame(gameImage);
                    for (int i = 0; i < intentions.Count; i++)
                    {
                        intentions[i].Learning(false);
                    }
                    SceneManager.LoadScene(SMane.Scenes("Result"));
                }

                //ラウンドを進める
                if (!Finish.GetDraw)
                {
                    rounds += 1;
                }

                Round.Initialize();
                Fight.Initialize();
                Finish.Initialize();
                Winner.Initialize();
                TimeUp.Initialize();
                Director.Initialize();

                PController1P.Initialize();
                PController2P.Initialize();

                disF       = true;
                fade.FFlag = false;
                timer.ResetGameTimer();
                soundPlayed = false;
            }
        }
    }