示例#1
0
        /// <summary> Returns the UICanvas named 'PopupCanvas' and sets its render mode to ScreenSpaceOverlay </summary>
        public static UICanvas GetPopupOverlayCanvas()
        {
            UICanvas canvas = UICanvas.GetUICanvas(DEFAULT_POPUP_CANVAS_NAME, true);

            canvas.Canvas.renderMode   = RenderMode.ScreenSpaceOverlay;
            canvas.Canvas.sortingOrder = DEFAULT_POPUP_CANVAS_OVERLAY_SORT_ORDER;
            return(canvas);
        }
示例#2
0
 /// <summary> Returns either the UICanvas named 'PopupCanvas' (if PopupDisplayOn.PopupCanvas) or another UICanvas with the target canvas name </summary>
 /// <param name="popupDisplayOn"> Where should the UIPopup be shown </param>
 /// <param name="targetCanvasName"> Target canvas name (used if PopupDisplayOn.TargetCanvas) </param>
 public static UICanvas GetTargetCanvas(PopupDisplayOn popupDisplayOn, string targetCanvasName)
 {
     return(popupDisplayOn == PopupDisplayOn.PopupCanvas ? GetPopupOverlayCanvas() : UICanvas.GetUICanvas(targetCanvasName));
 }