public static void ReleaseCanvas(HGUIRender render) { for (int i = 0; i < AllCanvas.Count; i++) { var can = AllCanvas[i]; if (can.render == render) { can.Dispose(); return; } } }
public static void RegCanvas(HGUIRender render) { for (int i = 0; i < AllCanvas.Count; i++) { if (AllCanvas[i].render == render) { render.canvas = AllCanvas[i]; return; } } var can = render.canvas; if (can == null) { can = new HCanvas(); can.m_sizeDelta = render.DesignSize; can.DesignSize = render.DesignSize; can.Pause = render.Pause; can.name = render.name; } can.render = render; render.canvas = can; AllCanvas.Add(can); }