111
This commit is contained in:
@@ -12,9 +12,6 @@ namespace Ichni.Menu
|
||||
public static MenuAudioManager instance;
|
||||
|
||||
public AudioContainer audioContainer;
|
||||
|
||||
public Switch testCptSwitch;
|
||||
public Switch testSongSwitch;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
||||
@@ -23,17 +23,30 @@ namespace Ichni.Menu
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
public SongSelectionRecord GetRecordOfThisChapter()
|
||||
{
|
||||
ChapterSelectionUnit currentChapter = ChapterSelectionManager.instance.currentChapter;
|
||||
if (songSelectionRecords.TryGetValue(currentChapter, out SongSelectionRecord record))
|
||||
{
|
||||
return record;
|
||||
}
|
||||
else
|
||||
{
|
||||
return new SongSelectionRecord(currentChapter.songs[0], currentChapter.songs[0].difficultyDataList[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public struct SongSelectionRecord
|
||||
public class SongSelectionRecord
|
||||
{
|
||||
public SongItemData song;
|
||||
public DifficultyData difficulty;
|
||||
public int difficultyIndex;
|
||||
|
||||
public SongSelectionRecord(SongItemData song, DifficultyData difficulty)
|
||||
{
|
||||
this.song = song;
|
||||
this.difficulty = difficulty;
|
||||
difficultyIndex = song.difficultyDataList.IndexOf(difficulty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@ namespace Ichni
|
||||
public partial class MenuManager
|
||||
{
|
||||
AsyncOperation asyncOperation;
|
||||
public bool isEnteringGame;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -39,6 +40,21 @@ namespace Ichni
|
||||
|
||||
private void Start()
|
||||
{
|
||||
isEnteringGame = false;
|
||||
|
||||
if (InformationTransistor.instance.isReturnedFromGame)
|
||||
{
|
||||
startUIPage.mainCanvasGroup.gameObject.SetActive(false);
|
||||
ChapterSelectionManager.instance.currentChapter =
|
||||
InformationTransistor.instance.chapter;
|
||||
MenuAudioManager.instance.audioContainer.SetSwitch(
|
||||
ChapterSelectionManager.instance.currentChapter.chapterSwitch);
|
||||
MenuInformationRecorder.instance.songSelectionRecords.Add(
|
||||
ChapterSelectionManager.instance.currentChapter,
|
||||
new SongSelectionRecord(InformationTransistor.instance.song, InformationTransistor.instance.difficulty));
|
||||
songSelectionUIPage.FadeIn();
|
||||
}
|
||||
|
||||
Application.targetFrameRate = SettingsManager.instance.gameSettings.targetFrame;
|
||||
asyncOperation = SceneManager.LoadSceneAsync("GameScene");
|
||||
asyncOperation.allowSceneActivation = false;
|
||||
|
||||
@@ -7,10 +7,14 @@ namespace Ichni.Menu
|
||||
{
|
||||
public class SoundBankInitializer : MonoBehaviour
|
||||
{
|
||||
public bool initialized = false;
|
||||
public List<Bank> soundBanks;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (initialized) return;
|
||||
|
||||
initialized = true;
|
||||
soundBanks.ForEach(bank => bank.Load());
|
||||
Debug.Log("AudioManager initialized with " + soundBanks.Count + " sound banks loaded.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user