文档

Unity Engine

Unity Engine

OnEnable()

Called when the graph is created or loaded in the editor.
阅读时间1 分钟最后更新于 1 个月前

Definition

public virtual void OnEnable()

Remarks

Override this method to perform setup tasks, such as allocating resources, initializing internal state, or preparing data for editing. This method is invoked each time the graph becomes active in the editor, including after domain reload or when reopening the asset. This method complements Graph.OnDisable and is useful for maintaining consistency across editor sessions.