Search Unity

Question What should I use instead of OnRectTransformDimensionsChange (respond to RectTransform changes)

Discussion in 'UGUI & TextMesh Pro' started by mortoray, Aug 11, 2023.

  1. mortoray

    mortoray

    Joined:
    Sep 14, 2018
    Posts:
    94
    I'm trying to listen to changes in a RectTransform. The only option I've found is `OnRectTransformDimensionsChange` but it's no longer part of the document. I can find it in legacy documentation, but not in the recent docs. It still works, but I wonder if there is some other way I should be listening to RectTransform updates?
     
  2. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    I expect that to not be deprecated anytime soon, it's quite a central part of the UI system.
    It's also mentioned in a 2023's release notes:
    "Editor: Fixed OnRectTransformDimensionsChange is not called on Undo. (UUM-16963)": link