EditorApplication.hierarchyWindowChanged

Could someone please guide me to a more useful resource than the one described within the reference docs, on how i can use this.

I have used the @script ExecuteInEditMode, and than tried to use a regular update, and i realise that the return is a callback, not boolean, but im really unclear on how to use this, and cant seem to locate any articles relating to Unity on the subject.

	function Update(){
	
		if(EditorApplication.hierarchyWindowChanged == true){
			Debug.Log("true");
		}
	}

from what i have read, delegates seem to be a issue within Unitys .js? Prime reason to use c#, haha , but still , there must be a way to use it in .JS?

Thanks.

And as i dug a little more and found a snippet using a delegate in .js somewhere totally unrelated, heres what i found.

function SomeFunction(){
    EditorApplication.hierarchyWindowChanged = CustomHierarchyChanged;
}

function CustomHierarchyChanged(){
      // do some stuff here.
}

Pretty simple, Hope it helps anyone else looking …

1 Like