UGUI Layout 标记更新
2021-07-25 19:02:56 2 举报
UGUI Layout 标记更新
作者其他创作
大纲/内容
SetDirty()时,MarkLayoutForRebuild(rectTransform);SetDirtyCaching()时,MarkLayoutForRebuild(rectTransform);OnDisable时,MarkLayoutForRebuild(rectTransform);
OnEable()时,RegisterCanvasElementForLayoutRebuild(this);SetDirtyCaching()时,RegisterCanvasElementForLayoutRebuild(this);OnDisable()时,UnRegisterCanvasElementForRebuild(this);
SetDirty()时,MarkLayoutForRebuild(rectTransform);OnDisable()时,MarkLayoutForRebuild(rectTransform);
LayoutElement
SetLayoutDirty()时,MarkLayoutForRebuild(rectTransform);OnBeforeTransformParentChanged()时,MarkLayoutForRebuild(rectTransform);OnDisable()时,MarkLayoutForRebuild(rectTransform);
博客专栏:https://blog.csdn.net/nratel/category_11133596.html
ContentSizeFitter
先找到 layoutRoot(layoutRoot:嵌套 LayoutGroup 的最顶层布局控制器)然后将layoutRoot对应的LayoutRebuiilder注册入 CanvasUpdateRegistryTryRegisterCanvasElementForLayoutRebuild(rebuilder);
InputField
OnDisable()时,MarkLayoutForRebuild(rectTransform);
OnDisable()时,UnRegisterCanvasElementForRebuild(this);
CanvasUpdateRegistry
RectTransform.reapplyDrivenProperties += ReapplyDrivenProperties; MarkLayoutForRebuild();
Graphic
RectTransform(toBuild)
SetDirty()时,MarkLayoutForRebuild(rectTransform);
LayoutGroup(abstract)
AspectRatioFitter
LayoutRebuilder
ScrollRect
0 条评论
下一页