修复
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user