Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

List Of Messages Sent To MonoBehaviour

Discussion in 'UGUI & TextMesh Pro' started by JAKJ, Sep 5, 2014.

  1. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    Where can we find a list of the new messages introduced to MonoBehaviour, such as OnTransformParentChanged, OnTransformChildrenChanged, and OnRectTransformDimensionsChange? The scripting reference for MonoBehaviour included with the beta does not include them.
     
    Kylotan likes this.
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,181
    • OnBeforeTransformParentChanged
    • OnTransformParentChanged
    • OnTransformChildrenChanged
    • OnRectTransformDimensionsChanged
    • OnRectTransformRemoved
    • OnCanvasGroupChanged
    Need to add this to the docs still...
     
    Kylotan likes this.
  3. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    Yeah, the messages thing is tough because I can't just open up my assembly and look at virtuals/abstracts since they don't exist. It's easier for the UI stuff because things like LayoutGroup added virtuals mirroring the messages (which is how I noticed these exist at all).
     
  4. secondbreakfast

    secondbreakfast

    Joined:
    Jan 5, 2013
    Posts:
    98
    I'm able to browse the assembly in mono develop. Just press F12 on one of the UI classes and it opens up and shows all the classes and methods for the UI library. Btw those virtual methods are in the UIBehavior parent class.
     
  5. GibTreaty

    GibTreaty

    Joined:
    Aug 25, 2010
    Posts:
    792
    I'd love to have a couple more added.
    OnComponentAdded(Component component)
    OnComponentRemoved(Component component)

    It'd be useful for hooking into and unhooking from C# events.
     
  6. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    No, the UIBehaviour virtual methods just receive the messages sent to MonoBehaviour (its parent class). OnTransformParentChanged and such are called by reflection just like Awake/Start/Update et cetera are.
     
  7. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    the preview shows this sometimes... oh not those ones i guess

     
  8. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    Events and messages are different things. Messages are reflection function calls that Unity's been using all along (see SendMessage), and events are with the new event system in 4.6 that can be handled either with delegates or with script attachments.
     
  9. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    149
    Seems that somewhere a 'd' was lost in the battle, because OnRectTransformDimensionsChange is recognized but not OnRectTransformDimensionsChanged.

    And all other messages are in the xxxChanged form...

    Check:
    http://docs.unity3d.com/460/Documen....Graphic.OnRectTransformDimensionsChange.html
     
    dreasgrech and rakkarage like this.
  10. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    149
    And checking the docs, seems that OnDisconnectedFromMasterServer is not documented (but OnDisconnectedFromServer is).