设置。。。
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using NBC;
|
||||
using Unity.VisualScripting;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
@@ -13,6 +14,8 @@ namespace NBF
|
||||
|
||||
private List<TabListSettingData> tabList = new List<TabListSettingData>();
|
||||
|
||||
private object _currentSettingsObject;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
base.OnInit();
|
||||
@@ -50,20 +53,32 @@ namespace NBF
|
||||
private void ChangeTab(int index)
|
||||
{
|
||||
Log.Info($"Change tab index={index}");
|
||||
// var tabListData = _tabList[index];
|
||||
// _currentTab = tabListData;
|
||||
// SubMenu.SetTabs(_currentTab.SubTab);
|
||||
var tabListData = tabList[index];
|
||||
_currentSettingsObject = tabListData.SettingsObject;
|
||||
ResetSettingList();
|
||||
}
|
||||
|
||||
|
||||
private void ResetSettingList()
|
||||
{
|
||||
List.RemoveChildrenToPool();
|
||||
if (_currentSettingsObject == null) return;
|
||||
var fields = _currentSettingsObject.GetType().GetFields();
|
||||
foreach (var field in fields)
|
||||
{
|
||||
if (List.AddItemFromPool() is SettingItem item)
|
||||
{
|
||||
item.SetData(field, _currentSettingsObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Reset()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
|
||||
Reference in New Issue
Block a user