Search Unity

EditorApplication.hierarchyWindowChanged

Discussion in 'Scripting' started by TheCasual, Feb 20, 2012.

  1. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    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.

    Code (csharp):
    1.     function Update(){
    2.    
    3.         if(EditorApplication.hierarchyWindowChanged == true){
    4.             Debug.Log("true");
    5.         }
    6.     }
    7.  
    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.
     
    Last edited: Feb 20, 2012
  2. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    And as i dug a little more and found a snippet using a delegate in .js somewhere totally unrelated, heres what i found.

    Code (csharp):
    1.  
    2.  
    3. function SomeFunction(){
    4.     EditorApplication.hierarchyWindowChanged = CustomHierarchyChanged;
    5. }
    6.  
    7. function CustomHierarchyChanged(){
    8.       // do some stuff here.
    9. }
    10.  
    11.  
    Pretty simple, Hope it helps anyone else looking ...
     
    Develax likes this.