private void OnEnable() { generator = target as ProceduralTextureGenerator; Undo.undoRedoPerformed += RefreshGenerator; }