public Canvas GetCanvasByLevel(eUICanvasLevel level) { GameObject go; Canvas canvas = null; if (UICanvasDic.TryGetValue((int)level, out go)) { canvas = (Canvas)go.GetComponentInChildren <Canvas>(); } return(canvas); }
public GameObject GetUICanvaRootsByLevel(eUICanvasLevel level) { GameObject go = null; GameObject root = null; //return UICanvasDic.TryGetValue((int)level, out go) ? go : null; if (UICanvasDic.TryGetValue((int)level, out go)) { if (go != null) { root = go.transform.gameObject; } } if (root == null) { Debuger.LogError("GetUICanvaRootsByLevel is fail, return root is null"); } return(root); }