2025-06-03 02:42:28 -04:00
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
2025-06-06 10:14:55 -04:00
|
|
|
using System.Linq;
|
|
|
|
|
using AK.Wwise;
|
2025-06-03 02:42:28 -04:00
|
|
|
using Sirenix.OdinInspector;
|
|
|
|
|
using UnityEngine;
|
2025-06-14 14:42:49 -04:00
|
|
|
using UnityEngine.Serialization;
|
2025-06-03 02:42:28 -04:00
|
|
|
|
|
|
|
|
namespace Ichni.Menu
|
|
|
|
|
{
|
|
|
|
|
[CreateAssetMenu(fileName = "DefaultChapter", menuName = "Ichni/UI/ChapterSelectionUnit", order = 0)]
|
|
|
|
|
public class ChapterSelectionUnit : SerializedScriptableObject
|
|
|
|
|
{
|
|
|
|
|
public string chapterIndex;
|
|
|
|
|
public string chapterName;
|
|
|
|
|
public string chapterSubtitle;
|
|
|
|
|
public Color themeColor;
|
|
|
|
|
public Sprite avatar;
|
2025-06-06 10:14:55 -04:00
|
|
|
public Switch chapterSwitch;
|
2025-06-03 02:42:28 -04:00
|
|
|
|
|
|
|
|
[ListDrawerSettings(ShowFoldout = true)]
|
|
|
|
|
public List<SongItemData> songs = new List<SongItemData>();
|
2025-06-06 10:14:55 -04:00
|
|
|
|
|
|
|
|
[Button]
|
|
|
|
|
public void SetUpDefaultDifficulties()
|
|
|
|
|
{
|
|
|
|
|
foreach (SongItemData song in songs)
|
|
|
|
|
{
|
|
|
|
|
if(song.difficultyDataList.All(d => d.difficultyName != "Easy"))
|
|
|
|
|
{
|
2025-07-26 04:20:25 -04:00
|
|
|
song.difficultyDataList.Add(new DifficultyData(
|
|
|
|
|
0, "Easy","Easy", 0, "",
|
2025-06-06 10:14:55 -04:00
|
|
|
new Color(0f, 0.7f, 0.2f, 1f)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (song.difficultyDataList.All(d => d.difficultyName != "Hard"))
|
|
|
|
|
{
|
2025-07-26 04:20:25 -04:00
|
|
|
song.difficultyDataList.Add(new DifficultyData(
|
|
|
|
|
1,"Hard", "Hard", 0, "",
|
2025-06-06 10:14:55 -04:00
|
|
|
new Color(1f, 0.2f, 0.2f, 1f)));
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-07-10 08:42:30 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Button]
|
|
|
|
|
public void SelectSwitch()
|
|
|
|
|
{
|
|
|
|
|
MenuAudioManager.instance.audioContainer.SetSwitch(chapterSwitch);
|
2025-06-06 10:14:55 -04:00
|
|
|
}
|
2025-06-03 02:42:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[InlineProperty]
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class SongItemData
|
|
|
|
|
{
|
2025-06-06 10:14:55 -04:00
|
|
|
[FoldoutGroup("$songName", true)]
|
2025-06-03 02:42:28 -04:00
|
|
|
public string songName;
|
|
|
|
|
|
|
|
|
|
[FoldoutGroup("$songName")]
|
|
|
|
|
public string displaySongName;
|
|
|
|
|
|
|
|
|
|
[FoldoutGroup("$songName")]
|
2025-07-21 05:42:20 -04:00
|
|
|
public string composer;
|
2025-06-03 02:42:28 -04:00
|
|
|
|
|
|
|
|
[FoldoutGroup("$songName")]
|
2025-06-06 10:14:55 -04:00
|
|
|
public Switch songSwitch;
|
2025-06-03 02:42:28 -04:00
|
|
|
|
|
|
|
|
[FoldoutGroup("$songName")]
|
2025-07-21 05:42:20 -04:00
|
|
|
public Sprite illustration;
|
2025-06-03 02:42:28 -04:00
|
|
|
|
|
|
|
|
[FoldoutGroup("$songName")]
|
|
|
|
|
public string illustratorName;
|
|
|
|
|
|
|
|
|
|
[FoldoutGroup("$songName")]
|
|
|
|
|
public string additionalInformation;
|
|
|
|
|
|
|
|
|
|
[FoldoutGroup("$songName")]
|
|
|
|
|
public List<DifficultyData> difficultyDataList;
|
2025-07-26 04:20:25 -04:00
|
|
|
|
|
|
|
|
[FoldoutGroup("$songName")]
|
|
|
|
|
public string unlockKey;
|
2025-06-03 02:42:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class DifficultyData
|
|
|
|
|
{
|
2025-07-21 05:42:20 -04:00
|
|
|
public int difficultyIndex;
|
2025-06-03 02:42:28 -04:00
|
|
|
public string difficultyName;
|
|
|
|
|
public string displayDifficultyName;
|
2025-06-14 14:42:49 -04:00
|
|
|
public int difficultyValue;
|
2025-07-21 05:42:20 -04:00
|
|
|
public string charterName;
|
2025-06-03 02:42:28 -04:00
|
|
|
public Color color;
|
|
|
|
|
|
2025-07-21 05:42:20 -04:00
|
|
|
public DifficultyData(int difficultyIndex, string difficultyName, string displayDifficultyName, int difficultyValue, string charterName, Color color)
|
2025-06-03 02:42:28 -04:00
|
|
|
{
|
2025-07-21 05:42:20 -04:00
|
|
|
this.difficultyIndex = difficultyIndex;
|
2025-06-03 02:42:28 -04:00
|
|
|
this.difficultyName = difficultyName;
|
|
|
|
|
this.displayDifficultyName = displayDifficultyName;
|
2025-07-21 05:42:20 -04:00
|
|
|
this.charterName = charterName;
|
2025-06-14 14:42:49 -04:00
|
|
|
this.difficultyValue = difficultyValue;
|
2025-06-03 02:42:28 -04:00
|
|
|
this.color = color;
|
|
|
|
|
}
|
2025-07-21 05:42:20 -04:00
|
|
|
|
|
|
|
|
public string GetDifficultyName()
|
|
|
|
|
{
|
|
|
|
|
return string.IsNullOrEmpty(displayDifficultyName) ? difficultyName : displayDifficultyName;
|
|
|
|
|
}
|
2025-06-03 02:42:28 -04:00
|
|
|
}
|
|
|
|
|
}
|