1
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Menu;
|
||||
using Ichni.UI;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni
|
||||
{
|
||||
public partial class ChapterSelectionManager : SerializedMonoBehaviour
|
||||
{
|
||||
public static ChapterSelectionManager instance;
|
||||
|
||||
public ChapterSelectionUIPage chapterSelectionUIPage;
|
||||
public List<ChapterSelectionUnit> chapters;
|
||||
|
||||
}
|
||||
|
||||
public partial class ChapterSelectionManager
|
||||
{
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8aa09572a86d1ab47af92aa372e1f90d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
97
Assets/Scripts/Menu/ChapterSelection/ChapterSelectionUnit.cs
Normal file
97
Assets/Scripts/Menu/ChapterSelection/ChapterSelectionUnit.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AK.Wwise;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
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;
|
||||
public Switch chapterSwitch;
|
||||
|
||||
[ListDrawerSettings(ShowFoldout = true)]
|
||||
public List<SongItemData> songs = new List<SongItemData>();
|
||||
|
||||
[Button]
|
||||
public void SetUpDefaultDifficulties()
|
||||
{
|
||||
foreach (SongItemData song in songs)
|
||||
{
|
||||
if(song.difficultyDataList.All(d => d.difficultyName != "Easy"))
|
||||
{
|
||||
song.difficultyDataList.Add(new DifficultyData("Easy","", "",
|
||||
new Color(0f, 0.7f, 0.2f, 1f)));
|
||||
}
|
||||
|
||||
if (song.difficultyDataList.All(d => d.difficultyName != "Hard"))
|
||||
{
|
||||
song.difficultyDataList.Add(new DifficultyData("Hard", "", "",
|
||||
new Color(1f, 0.2f, 0.2f, 1f)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[InlineProperty]
|
||||
[Serializable]
|
||||
public class SongItemData
|
||||
{
|
||||
[FoldoutGroup("$songName", true)]
|
||||
public string songName;
|
||||
|
||||
[FoldoutGroup("$songName")]
|
||||
public string displaySongName;
|
||||
|
||||
[FoldoutGroup("$songName")]
|
||||
public string author;
|
||||
|
||||
[FoldoutGroup("$songName")]
|
||||
public bool isNewSong;
|
||||
|
||||
[FoldoutGroup("$songName")]
|
||||
public Switch songSwitch;
|
||||
|
||||
[FoldoutGroup("$songName")]
|
||||
public Sprite albumIconCover;
|
||||
|
||||
[FoldoutGroup("$songName")]
|
||||
public Sprite albumIllustrationCover;
|
||||
|
||||
[FoldoutGroup("$songName")]
|
||||
public string illustratorName;
|
||||
|
||||
[FoldoutGroup("$songName")]
|
||||
public string additionalInformation;
|
||||
|
||||
[FoldoutGroup("$songName")]
|
||||
public List<DifficultyData> difficultyDataList;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class DifficultyData
|
||||
{
|
||||
public string difficultyName;
|
||||
public string displayDifficultyName;
|
||||
|
||||
public string designerName;
|
||||
public Color color;
|
||||
|
||||
public DifficultyData(string difficultyName, string displayDifficultyName, string designerName, Color color)
|
||||
{
|
||||
this.difficultyName = difficultyName;
|
||||
this.displayDifficultyName = displayDifficultyName;
|
||||
this.designerName = designerName;
|
||||
this.color = color;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf4450f8404fb5d4991d2b5a7973ba31
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user