예제 #1
0
파일: HCanvas.cs 프로젝트: huqiang0204/HGUI
 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;
         }
     }
 }
예제 #2
0
파일: HCanvas.cs 프로젝트: huqiang0204/HGUI
        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);
        }