Beispiel #1
0
    public void OnClick(int stagenum)
    {
        if (FadeManager.CheckIsFade())
        {
            return;
        }

        GameMasterBehavior.SetStageAndChapter(stagenum);

        if (stagenum == 0)
        {
            BackMenu();
        }

        if (stagenum != 0)
        {// ステージが選択された
            PauseTheGame.SetTimeScale(1.0f);
            FadeManager.BeginSetting();
            FadeManager.NextColor = Color.black;
            FadeManager.SetUnmaskImage(FadeManager.ImageIndex.STAR);
            FadeManager.AddState(FadeManager.State.UNMASK);
            FadeManager.AddState(FadeManager.State.UNMASK_BIGGER);
            FadeManager.UnmaskSize_Start         = new Vector2(Screen.width * 10, Screen.height * 10);
            FadeManager.UnmaskSize_End           = new Vector2(0.01f, 0.01f);
            GameMasterBehavior.isInitiationEvent = true;

            NextSceneIndex(stagenum);
        }
    }
Beispiel #2
0
 private void SettingScene()
 {
     FadeManager.BeginSetting();
     FadeManager.NextColor = Color.black;
     FadeManager.SetUnmaskImage(FadeManager.ImageIndex.STAR);
     FadeManager.AddState(FadeManager.State.UNMASK);
     FadeManager.AddState(FadeManager.State.UNMASK_BIGGER);
     FadeManager.UnmaskSize_Start         = new Vector2(Screen.width * 10, Screen.height * 10);
     FadeManager.UnmaskSize_End           = new Vector2(0.01f, 0.01f);
     GameMasterBehavior.isInitiationEvent = true;
 }
Beispiel #3
0
 public void ResetWorld()
 {
     FadeManager.BeginSetting();
     FadeManager.NextColor = Color.black;
     FadeManager.SetUnmaskImage(FadeManager.ImageIndex.STAR);
     FadeManager.AddState(FadeManager.State.UNMASK);
     FadeManager.AddState(FadeManager.State.UNMASK_BIGGER);
     FadeManager.UnmaskSize_Start         = new Vector2(Screen.width * 10, Screen.height * 10);
     FadeManager.UnmaskSize_End           = new Vector2(0.01f, 0.01f);
     GameMasterBehavior.isInitiationEvent = false;
     FadeManager.SceneOut("scene0315");
 }
Beispiel #4
0
 private void IsChangeScene()
 {
     if (m_VCamScript.VCamLimitPos())
     {
         if ((m_Timer += Time.deltaTime) >= TIMELIMIT && !FadeManager.CheckIsFade())
         {
             GameMasterBehavior.isInitiationEvent = true;
             FadeManager.BeginSetting();
             FadeManager.NextColor   = Color.black;
             FadeManager.NextColor.a = 0.0f;
             FadeManager.AddState(FadeManager.State.A_TO_ONE);
             FadeManager.SceneOut("scene0315");
         }
     }
 }
Beispiel #5
0
    void SceneChange()
    {
        if (GameEnd)
        {
            return;
        }

        if (!m_CloneMainVCam.activeSelf)
        {
            m_Timer += Time.deltaTime;
            if (m_Timer >= TIME_TO_SCENE_TRANSITION && CheckFlag != true)
            {
                if (IsCheckStageChange())
                {
                    if (GameMasterBehavior.EndingGame())
                    {
                        FadeManager.BeginSetting();
                        FadeManager.NextColor   = Color.black;
                        FadeManager.NextColor.a = 0f;
                        FadeManager.AddState(FadeManager.State.A_TO_ZERO);
                        FadeManager.SceneOut("TitleScene");
                        GameEnd = true;
                    }
                    else
                    {
                        FadeManager.BeginSetting();
                        FadeManager.NextColor   = Color.black;
                        FadeManager.NextColor.a = 0f;
                        FadeManager.AddState(FadeManager.State.A_TO_ZERO);
                        FadeManager.SceneOut("BeginingEventScene");
                        CheckFlag = true;
                    }
                }
                else
                {
                    FadeManager.BeginSetting();
                    FadeManager.NextColor   = Color.black;
                    FadeManager.NextColor.a = 0f;
                    FadeManager.AddState(FadeManager.State.A_TO_ONE);
                    FadeManager.SceneOut("Scene0315");
                    CheckFlag = true;
                }
            }
        }
    }
Beispiel #6
0
    public void OnClick()
    {
        if (FadeManager.CheckIsFade())
        {
            return;
        }
        if (gameObject.name == "ReturnToGame")
        {// ゲームに戻る
            PauseTheGame.SetTimeScale(1.0f);
            m_MenuDelete.SwitchActive();
        }
        if (gameObject.name == "RestartStage")
        {// ステージをやり直す
            PauseTheGame.SetTimeScale(1.0f);

            // Fadeの設定はResetWorld関数内で行ってます

            m_ObjPlayerCmdBhv.GetComponent <PlayerCommandBehavior>().RedoTheStage();
            m_MenuDelete.SwitchActive();
        }
        if (gameObject.name == "SelectStage")
        {// ステージ選択
            m_ObjStageSelectCanvas.gameObject.SetActive(true);
            m_ObjMenuCanvas.gameObject.SetActive(false);
        }
        if (gameObject.name == "ControllerLayout")
        {// 操作説明
        }
        if (gameObject.name == "BackToTitle")
        {// タイトルに戻る
            PauseTheGame.SetTimeScale(1.0f);
            FadeManager.BeginSetting();
            FadeManager.NextColor = Color.black;
            FadeManager.SetUnmaskImage(FadeManager.ImageIndex.STAR);
            FadeManager.AddState(FadeManager.State.UNMASK);
            FadeManager.AddState(FadeManager.State.UNMASK_BIGGER);
            FadeManager.UnmaskSize_Start         = new Vector2(Screen.width * 10, Screen.height * 10);
            FadeManager.UnmaskSize_End           = new Vector2(0.01f, 0.01f);
            GameMasterBehavior.isInitiationEvent = true;
            FadeManager.SceneOut("TitleScene");
        }
    }
Beispiel #7
0
    // Start is called before the first frame update
    void Start()
    {
        // フェードイン
        FadeManager.BeginSetting();
        FadeManager.NextColor = Color.black;
        FadeManager.AddState(FadeManager.State.A_TO_ZERO);
        FadeManager.SceneIn();

        // UI objectを生成.
        GameObject menu = Instantiate(m_ParentCanvasPrefab);

        menu.GetComponent <ParentMenuCanvasBehavior>().SetActivateSelectionCursor();

        // サウンド
        Instantiate(m_SoundManagerPrefab);

        SoundManagerBehaviour.Instance.Play(SoundManagerBehaviour.AudioIndex.BGM_Title, true, false);

        // 背景用のシーン読込
        SceneManager.LoadScene("GameBackGround", LoadSceneMode.Additive);
    }
Beispiel #8
0
    public Material InitSkyBox; /* ! ココ! */

    private void Start()
    {
        if (initiatingStage.Chapter == 0)
        {
            initiatingStage = new StageInfo(1, 1);
        }

        if (BeginningEventMasterBehaviour.skyBox == null)
        {
            RenderSettings.skybox = BeginningEventMasterBehaviour.skyBox = InitSkyBox;;
        }
        else
        {
            RenderSettings.skybox = BeginningEventMasterBehaviour.skyBox;
        }


        PauseTheGame.SetTimeScale(1.0f);
        FadeManager.BeginSetting();
        FadeManager.NextColor = Color.black;
        FadeManager.SetImage(FadeManager.ImageIndex.NONE);
        FadeManager.AddState(FadeManager.State.A_TO_ZERO);
        FadeManager.SceneIn();

        // ステージ情報を書いたテキストファイルの読み込み
        var mapData = MapLoader.LoadMap(initiatingStage);

        // 世界を作る.
        GameObject starMaker = Instantiate(m_StarMakerPrefab);

        StarMaker.Instance.MakeWorld(mapData, Common.CellSize);

        // グリッド線を生成する.
        var gc = Instantiate(m_GridCylinderPrefab);

        gc.GetComponent <GridCylinderBehaviour>().Init();

        // UIオブジェクトを生成.
        GameObject menu = Instantiate(m_MenuCanvas);

        menu.SetActive(false);

        // プレイヤーコントローラを生成し,にプレイヤーキャラクターをセット.
        GameObject playerController       = Instantiate(m_PlayerCommand);
        var        scriptPlayerController = playerController.GetComponent <PlayerCommandBehavior>();

        scriptPlayerController.SetCurrentSceneMenu(menu);

        // Camera
        var camera       = GameObject.FindGameObjectWithTag(ObjectTag.MainCamera);
        var cameraScript = camera.GetComponent <InGameMainCameraController>();

        // ゲームスタート時イベント有り無し
        Instantiate(m_ParticleManagerPrefab);

        // サウンド
        Instantiate(m_SoundManagerPrefab);

        // カメラとかの設定
        if (isInitiationEvent)
        {
            // ゴールからスタートまで星を映すモード
            cameraScript.SetCurrentState(InGameMainCameraController.StateName.MovingFromGoalToStart);
            var takoScript = GameObject.FindGameObjectWithTag(ObjectTag.PlayerCharacter).GetComponent <Tako.TakoController>();
            takoScript.SetCurrentState(Tako.TakoController.StateName.CommandDisable);
        }
        else
        {
            cameraScript.SetTarget(GameObject.FindGameObjectWithTag(ObjectTag.PlayerCharacter));
            cameraScript.SetCurrentState(InGameMainCameraController.StateName.Following);
        }

        // 土屋君、ここの"ステージ == 数値"を増やしてほしいにゃぁ。コピー版
        if (GameMasterBehavior.InitiatingStage.Stage == 1 || GameMasterBehavior.InitiatingStage.Stage == 0)
        {
            SoundManagerBehaviour.Instance.Play(SoundManagerBehaviour.AudioIndex.BGM_Stage1, true, false);
            // 背景用のシーン読込
            SceneManager.LoadScene("GameBackGround", LoadSceneMode.Additive);
        }
        else if (GameMasterBehavior.InitiatingStage.Stage == 2)
        {
            SoundManagerBehaviour.Instance.Play(SoundManagerBehaviour.AudioIndex.BGM_Stage2, true, false);
            // 背景用のシーン読込
            SceneManager.LoadScene("GameBackGround 2", LoadSceneMode.Additive);
        }
        else if (GameMasterBehavior.InitiatingStage.Stage == 3)
        {
            SoundManagerBehaviour.Instance.Play(SoundManagerBehaviour.AudioIndex.BGM_Stage3, true, false);
            // 背景用のシーン読込
            SceneManager.LoadScene("GameBackGround 3", LoadSceneMode.Additive);
        }
        else if (GameMasterBehavior.InitiatingStage.Stage == 4)
        {
            SoundManagerBehaviour.Instance.Play(SoundManagerBehaviour.AudioIndex.BGM_Stage3, true, false);
            // 背景用のシーン読込
            SceneManager.LoadScene("GameBackGround 4", LoadSceneMode.Additive);
        }
    }