34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using System.Collections.Generic;
|
|
|
|
public enum SettingType
|
|
{
|
|
Normal, // Îáû÷íàÿ íàñòðîéêà - Accept îòêðûâàåò îïöèè
|
|
Panel, // Ïàíåëü - Óäåðæàíèå îòêðûâàåò ïàíåëü íàïðÿìóþ
|
|
Action, // Äåéñòâèå - Accept âûïîëíÿåò äåéñòâèå ñðàçó
|
|
Svitcher // Ïåðåêëþ÷àòåëü - âêë - âûêë
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class SettingOption
|
|
{
|
|
public string settingName;
|
|
public List<string> options;
|
|
public int chosenIndex;
|
|
public int defaultIndex;
|
|
|
|
public SettingType type = SettingType.Normal;
|
|
public int panelId = -1; // ID ïàíåëè: 0-2 äëÿ TextInput, 3 äëÿ CharacterSetting
|
|
|
|
|
|
public SettingOption(string settingName, List<string> options, int defaultIndex, SettingType type = SettingType.Normal, int panelId = -1)
|
|
{
|
|
this.settingName = settingName;
|
|
this.options = options;
|
|
this.defaultIndex = defaultIndex;
|
|
this.chosenIndex = defaultIndex;
|
|
this.type = type;
|
|
this.panelId = panelId;
|
|
}
|
|
public string ChosenOption => options[chosenIndex];
|
|
}
|