Beispiel #1
0
    private async void RebuildLayout()
    {
        LayoutStaticizer.Activate(transform);
        LayoutFixer.Fix(transform);
        await UniTask.DelayFrame(5);

        if (this == null || transform == null)
        {
            return;
        }
        LayoutStaticizer.Staticize(transform);
    }
Beispiel #2
0
    private void InstantiateSettings()
    {
        SettingsFactory.InstantiateGeneralSettings(generalTab, true);
        SettingsFactory.InstantiateGameplaySettings(gameplayTab);
        SettingsFactory.InstantiateVisualSettings(visualTab);
        SettingsFactory.InstantiateAdvancedSettings(advancedTab, true);

        async void Fix(Transform transform)
        {
            LayoutStaticizer.Activate(transform);
            LayoutFixer.Fix(transform);
            await UniTask.DelayFrame(5);

            LayoutStaticizer.Staticize(transform);
        }

        Fix(generalTab.parent);
        Fix(gameplayTab.parent);
        Fix(visualTab.parent);
        Fix(advancedTab.parent);
    }
Beispiel #3
0
    protected virtual async void StartGame()
    {
        await UniTask.WhenAll(BeforeStartTasks);

        MusicStartedTimestamp = Music.PlayScheduled(AudioTrackIndex.Reserved1, 1.0f);

        await UniTask.Delay(TimeSpan.FromSeconds(1));

        if (Application.isEditor && EditorMusicInitialPosition > 0)
        {
            Music.PlaybackTime     = EditorMusicInitialPosition;
            MusicStartedTimestamp -= EditorMusicInitialPosition;
        }

        GameStartedOrResumedTimestamp = UnityEngine.Time.realtimeSinceStartup;
        State.IsStarted = true;
        State.IsPlaying = true;
        LayoutStaticizer.Staticize(levelInfoParent.transform);
        LayoutStaticizer.Staticize(modHolderParent.transform);
        onGameStarted.Invoke(this);

        if (Application.isEditor && EditorImmediatelyComplete && State.Mode != GameMode.GlobalCalibration &&
            State.Mode != GameMode.Calibration)
        {
            if (EditorImmediatelyCompleteFail)
            {
                Fail();
            }
            else
            {
                if (EditorCompletionDelay > 0)
                {
                    await UniTask.Delay(TimeSpan.FromSeconds(EditorCompletionDelay));
                }

                State.FillTestData(Chart.Model.note_list.Count);
                Complete();
            }
        }
    }