public bool AddToRebuild(IUILayout layout) { int hashcode = layout.GetHashCode(); if (!m_MapLayouts.Contains(hashcode)) { m_ListLayouts.Add(layout); m_MapLayouts.Add(hashcode); //for register ui canvas rebuild system CanvasUpdateRegistry.TryRegisterCanvasElementForLayoutRebuild(this); return(true); } else { return(false); } }
public static int TryRegisterCanvasElementForLayoutRebuild_s(IntPtr l) { int result; try { ICanvasElement element; LuaObject.checkType <ICanvasElement>(l, 1, out element); bool b = CanvasUpdateRegistry.TryRegisterCanvasElementForLayoutRebuild(element); LuaObject.pushValue(l, true); LuaObject.pushValue(l, b); result = 2; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
public static bool IsRectTransformLayoutRebuild(RectTransform rectTransform) { return(!CanvasUpdateRegistry.TryRegisterCanvasElementForLayoutRebuild(LayoutRebuilderUtility.GetLayoutRebuilder(rectTransform))); }