这是第一个 Unity 开放项目的repo,是 Unity 和社区合作创建的一个小型开源游戏演示,第一款游戏是一款名为 Chop Chop 的动作冒险游戏。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

104 行
1.8 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Localization;
using UnityEngine.Serialization;
[System.Serializable]
public enum SettingTabType
{
Language,
Audio,
Graphics
}
[System.Serializable]
public enum SettingFieldType
{
Language,
Volume_SFx,
Volume_Music,
Resolution,
FullScreen,
GraphicQuality,
AntiAliasing,
Shadow,
}
[System.Serializable]
public class settingTab
{
public SettingTabType settingTabsType;
public LocalizedString title;
}
[System.Serializable]
public class SettingField
{
public SettingTabType settingTabsType;
public SettingFieldType settingFieldType;
public LocalizedString title;
}
public class UISettingManager : MonoBehaviour
{
public List<settingTab> settingTabsList = new List<settingTab>();
[SerializeField]
private UISettingTabsFiller _settingTabFiller = default;
[SerializeField]
private List<SettingField> _settingFieldsList = default;
[SerializeField]
private UISettingFieldsFiller _settingFieldsFiller = default;
private void Start()
{
SetTabs();
SetFields(SettingTabType.Graphics);
}
public void SetTabs()
{
_settingTabFiller.FillTabs(settingTabsList);
}
public void SelectTab(SettingTabType selectedTab)
{
_settingTabFiller.SelectTab(selectedTab);
}
public void SetFields(SettingTabType selectedTab)
{
List<SettingField> fields= _settingFieldsList.FindAll(o => o.settingTabsType == selectedTab);
_settingFieldsFiller.FillFields(fields);
}
public void SelectField()
{
}
public void UnselectField()
{
}
public void NextOption()
{
}
public void PreviousOption()
{
}
public void OpenValidateChoicesPrompt()
{
}
public void ValidateChoices()
{
}
}