Beispiel #1
0
        private static void Add(UIData data)
        {
            if (data == null)
            {
                return;
            }

            if (m_UIDataMap.ContainsKey(data.uiID))
            {
                return;
            }

            m_UIDataMap.Add(data.uiID, data);

            m_UINameDataMap.Add(data.shortName, data);
        }
Beispiel #2
0
        public static RectTransform FindTransformInPanel(string targetPanelName, string targetUINodePath)
        {
            UIData data = UIDataTable.Get(targetPanelName);

            if (data == null)
            {
                return(null);
            }
            AbstractPanel panel = UIMgr.S.GetPanel((UIID)data.uiID);//UIMgr.S.uiRoot.panelRoot.Find(targetPanelName);

            if (panel == null)
            {
                return(null);
            }

            Transform targetPanel = panel.transform;

            if (targetPanel == null)
            {
                return(null);
            }

            if (string.IsNullOrEmpty(targetUINodePath))
            {
                return(targetPanel as RectTransform);
            }

            RectTransform result = targetPanel.Find(targetUINodePath) as RectTransform;

            if (result == null || !result.gameObject.activeSelf)
            {
                return(null);
            }

            return(result);
        }