shapes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace Ichni.Editor
|
||||
{
|
||||
dropdownComponent.CreateNewItem(name);
|
||||
}
|
||||
dropdownComponent.selectedItemIndex = 0;
|
||||
dropdownComponent.SetupDropdown();
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,8 @@ namespace Ichni.Editor
|
||||
dropdownComponent.CreateNewItem(item);
|
||||
}
|
||||
|
||||
// 统一刷新 UI
|
||||
// 统一刷新 UI前,重置 selectedItemIndex 为 0,防止前一次使用的残余索引越界
|
||||
dropdownComponent.selectedItemIndex = 0;
|
||||
dropdownComponent.SetupDropdown();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user