This commit is contained in:
SoulliesOfficial
2026-03-26 14:48:04 -04:00
parent 731726239a
commit 11423add8f
100 changed files with 196597 additions and 1049 deletions

View File

@@ -12,11 +12,6 @@ namespace Ichni.Editor
{
public Button button;
public TMP_Text buttonText;
public override void Initialize(IBaseElement baseElement, string title, string parameterName)
{
base.Initialize(baseElement, title, parameterName);
}
public void SetText(string buttonText)
{
this.buttonText.text = buttonText;
@@ -44,6 +39,13 @@ namespace Ichni.Editor
customAction?.Invoke();
}
public override void Initialize(IBaseElement baseElement, string title, string parameterName)
{
// 精确地仅重置 Button 的可交互状态(为了解决从对象池取回被禁用的废弃按钮问题)
if (button != null) button.interactable = true;
base.Initialize(baseElement, title, parameterName);
}
public override DynamicUIElement AddListenerFunction(UnityAction action)
{
customAction += action;

View File

@@ -36,6 +36,7 @@ namespace Ichni.Editor
{
dropdownComponent.CreateNewItem(name);
}
dropdownComponent.selectedItemIndex = 0;
dropdownComponent.SetupDropdown();
}

View File

@@ -56,7 +56,8 @@ namespace Ichni.Editor
dropdownComponent.CreateNewItem(item);
}
// 统一刷新 UI
// 统一刷新 UI前,重置 selectedItemIndex 为 0防止前一次使用的残余索引越界
dropdownComponent.selectedItemIndex = 0;
dropdownComponent.SetupDropdown();
}