After googling, it seems right now Unity doesn’t provide a general Window/Screen resize event for user to register callback, and I have used following successively in UGUI
to response to resizing event.
public class UICanvas : UIBehaviour
{
protected override void OnRectTransformDimensionsChange()
{
base.OnRectTransformDimensionsChange();
// do our resizing logic
}
}
I am upgrading old UGUI
to runtime UITK
, and wandering if similar functionality exist in UITK
to get Window/Screen resize event.
PS, I know the solution of polling Screen status and check for changes in Update
which i don’t like, and want to know alternative more elegant solutions.
Thanks.