86 lines
2.9 KiB
C#
86 lines
2.9 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using AK.Wwise;
|
|
using Ichni.Menu;
|
|
using Ichni.Story.UI;
|
|
using Ichni.UI;
|
|
using Sirenix.OdinInspector;
|
|
using SLSUtilities.WwiseAssistance;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.Serialization;
|
|
|
|
namespace Ichni
|
|
{
|
|
public partial class MenuManager : MonoBehaviour
|
|
{
|
|
public static MenuManager instance;
|
|
|
|
public StartUIPage startUIPage;
|
|
public ChapterSelectionUIPage chapterSelectionUIPage;
|
|
public StoryUIPage storyUIPage;
|
|
public DialogUIPage dialogUIPage;
|
|
public SongSelectionUIPage songSelectionUIPage;
|
|
public TransitionUIPage transitionUIPage;
|
|
public SettingsUIPage settingsUIPage;
|
|
|
|
public List<string> languageList;
|
|
public List<string> displayLanguageList;
|
|
}
|
|
|
|
public partial class MenuManager
|
|
{
|
|
AsyncOperation asyncOperation;
|
|
public bool isEnteringGame;
|
|
|
|
private void Awake()
|
|
{
|
|
instance = this;
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
isEnteringGame = false;
|
|
|
|
if (InformationTransistor.instance.isReturnedFromGame)
|
|
{
|
|
startUIPage.mainCanvasGroup.gameObject.SetActive(false);
|
|
ChapterSelectionManager.instance.currentChapter =
|
|
InformationTransistor.instance.chapter;
|
|
AudioManager.SetSwitch(ChapterSelectionManager.instance.currentChapter.chapterSwitch);
|
|
MenuInformationRecorder.instance.songSelectionRecords.Add(
|
|
ChapterSelectionManager.instance.currentChapter,
|
|
new SongSelectionRecord(InformationTransistor.instance.song, InformationTransistor.instance.difficulty));
|
|
songSelectionUIPage.FadeIn();
|
|
}
|
|
else if (InformationTransistor.instance.isReturnedFromTutorial)
|
|
{
|
|
startUIPage.mainCanvasGroup.gameObject.SetActive(false);
|
|
ChapterSelectionManager.instance.currentChapter = InformationTransistor.instance.chapter;
|
|
AudioManager.SetSwitch(ChapterSelectionManager.instance.currentChapter.chapterSwitch);
|
|
storyUIPage.FadeIn();
|
|
}
|
|
|
|
Application.targetFrameRate = SettingsManager.instance.gameSettings.targetFrame;
|
|
asyncOperation = SceneManager.LoadSceneAsync("GameScene");
|
|
asyncOperation.allowSceneActivation = false;
|
|
}
|
|
}
|
|
|
|
public partial class MenuManager
|
|
{
|
|
public void EnterGame()
|
|
{
|
|
InformationTransistor.instance.isReturnedFromTutorial = false;
|
|
InformationTransistor.instance.isReturnedFromGame = true;
|
|
EnterGameScene();
|
|
}
|
|
|
|
public void EnterGameScene()
|
|
{
|
|
MenuInputManager.instance.gameInput.Menu.Disable();
|
|
asyncOperation.allowSceneActivation = true;
|
|
}
|
|
}
|
|
} |