示例#1
0
    void Start()
    {
        camCtrl.Init();
        waveCtrl.Init();
        buildingCtrl.Init();
        uiCtrl.Init();
        partCtrl.Init();
        audioCtrl.Init();
        Init();

        //DEBUG
        StartWave();
    }
    private IEnumerator GameInit()
    {
        chartEle   = SetChartDifficlty(StaticValue.difficulty);
        gaugeRule  = (int)StaticValue.gaugeRule;
        noteSpeed  = StaticValue.noteSpeed;
        judgeStyle = StaticValue.judgeStyle;
        System.Array.Resize(ref uiData.judgeCount, timingRange[(int)judgeStyle].judges.Length);

        ChartStruct chart = musicStruct.charts[chartEle];

        timeController.Init(chart);
        tutorialController.Init(isTutorial);
        // 各コントローラーの初期化処理を非同期で行う
        yield return(StartCoroutine(notesController.GenerateNotes(gaugeStructs.gaugeRules[gaugeRule], chart, laneObjs)));

        yield return(StartCoroutine(measureController.Init(chart, laneObjsParent)));

        yield return(StartCoroutine(inputController.Init(laneObjs.Length)));

        yield return(StartCoroutine(starCountroller.Init()));

        yield return(StartCoroutine(particleController.Init()));

        yield return(StartCoroutine(LoadAudioData(musicStruct.musicFileName, loadName)));

        RenderSettings.skybox = backGroundData.backGroundMaterials[(int)musicStruct.backGroundType];

        notesController.UpdateManage(noteSpeed);
        measureController.MoveMeasure(noteSpeed, chart);

        // ScoreCountの計算
        uiData.maxScoreCount   = notesController.totalCombo * timingRange[(int)judgeStyle].judges[(int)JudgeType.Just].scoreCount;
        uiData.totalGaugeCount = notesController.totalGaugeCount;
        uiData.noteSpeed       = noteSpeed;
        uiData.bpm             = chart.bpm;
        uiData.gaugePer        = gaugeStructs.gaugeRules[gaugeRule].startPar;

        growAnim.SetFloat("Speed", chart.bpm / 120);

        musicSource.volume = musicStruct.musicVolume;

        uiCountroller.Init(
            uiData: uiData,
            gaugeRule: gaugeStructs.gaugeRules[gaugeRule],
            trackCount: StaticValue.trackCount,
            musicName: musicStruct.musicName,
            artistName: musicStruct.composer,
            difficulty: chart.difficulty,
            level: chart.level,
            timeLength: Clac.TimeByTimingCount(
                count: chart.chartLength,
                oneBeatCount: Clac.OneBeatCount(chart.beat, chart.beatParam),
                musicOffset: chart.musicOffset,
                bpm: chart.bpm,
                tempoChanger: chart.tempoChangers),
            isDemo: isDemoPlay,
            isTutorial: isTutorial
            );

        yield return(null);

        System.GC.Collect();
        yield return(null);

        isInitFinish = true;

        cookpitUIAnim.SetBool("Show", true);

        if (isDemoPlay || isTutorial)
        {
            // デモプレイ、チュートリアルはすぐに始める
            cookpitUIAnim.SetTrigger("NonAnim");
            isStarting = true;
        }
        else
        {
            keyInfoAnim.SetBool("KeyShow", true);
            yield return(new WaitForSeconds(1.0f));
        }
    }