This commit is contained in:
SoulliesOfficial
2026-06-09 07:00:19 -04:00
parent 5fc1392747
commit e97646ae48
6 changed files with 111 additions and 60 deletions

View File

@@ -31,10 +31,19 @@ namespace Ichni.Editor
public virtual void Initialize(IBaseElement baseElement, string title, string parameterName)
{
if (canvasGroup == null) canvasGroup = gameObject.AddComponent<CanvasGroup>();
// [对象池安全] 重置 CanvasGroup 状态,防止上次 EnabledIf 设置的禁用状态泄漏到新的元素实例
canvasGroup.interactable = true;
canvasGroup.alpha = 1f;
canvasGroup.blocksRaycasts = true;
this.connectedBaseElement = baseElement;
this.parameterName = parameterName;
if (title != string.Empty)
{
// [对象池安全] 确保标题 GameObject 处于激活状态,
// 防止上次以空标题使用时 SetActive(false) 的状态泄漏
this.title.gameObject.SetActive(true);
this.title.text = title;
}
else