public void OnValidate() { if (Application.isEditor) { //get content frames uIContentFrameControllers.Clear(); if (contentFrames != null) { int childCount = contentFrames.transform.childCount; for (int i = 0; i < childCount; i++) { UIContentFrameController uIContentFrameController = contentFrames.transform.GetChild(i).GetComponent <UIContentFrameController>(); if (uIContentFrameController != null) { uIContentFrameControllers.Add(uIContentFrameController); } } foreach (UIContentFrameController uIContentFrameController in uIContentFrameControllers) { uIContentFrameController.panelController = this; } } else { Debug.LogError("Content Frames is null in " + this); } //get tabs uITabControllers.Clear(); if (tabs != null) { int childCount = tabs.transform.childCount; for (int i = 0; i < childCount; i++) { UITabController uITabController = tabs.transform.GetChild(i).GetComponent <UITabController>(); if (uITabController != null) { uITabControllers.Add(uITabController); } } foreach (UITabController uITabController in uITabControllers) { uITabController.panelController = this; #if UNITY_EDITOR UnityEditor.EditorUtility.SetDirty(uITabController); #endif } } else { Debug.LogError("Tabs is null in " + this); } #if UNITY_EDITOR UnityEditor.EditorUtility.SetDirty(this); #endif } }
public void OnValidate() { //get content frames uIContentFrameControllers.Clear(); if (contentFrames != null) { int childCount = contentFrames.transform.childCount; for (int i = 0; i < childCount; i++) { UIContentFrameController uIContentFrameController = contentFrames.transform.GetChild(i).GetComponent <UIContentFrameController>(); if (uIContentFrameController != null) { uIContentFrameControllers.Add(uIContentFrameController); } } foreach (UIContentFrameController uIContentFrameController in uIContentFrameControllers) { uIContentFrameController.panelController = this; } } else { Debug.LogError("Content Frames is null in " + this); } //get tabs uITabControllers.Clear(); if (tabs != null) { int childCount = tabs.transform.childCount; for (int i = 0; i < childCount; i++) { UITabController uITabController = tabs.transform.GetChild(i).GetComponent <UITabController>(); if (uITabController != null) { uITabControllers.Add(uITabController); } } foreach (UITabController uITabController in uITabControllers) { uITabController.panelController = this; } } else { Debug.LogError("Tabs is null in " + this); } }
public override void Awake() { base.Awake(); Transform t = controller.transform; UIButton backBtn = t.Find("FrameBG/Panel/CancelBtn").GetComponent <UIButton>(); controller.backButton = backBtn; tabController = t.GetComponent <UITabController>("Content/ScrollView/Placeholder/ButtonList"); LoginRP = t.Find("Content/ScrollView/Placeholder/ButtonList/1_login/Btn/RedPoint").gameObject; TaskRP = t.Find("Content/ScrollView/Placeholder/ButtonList/2_task/Btn/RedPoint").gameObject; GiftRP = t.Find("Content/ScrollView/Placeholder/ButtonList/3_gift/Btn/RedPoint").gameObject; DayLabel = t.GetComponent <UILabel>("Content/ViewList/BG/TimeLabel/DayLabel"); TimeLabel = t.GetComponent <UILabel>("Content/ViewList/BG/TimeLabel/TimeLabel"); }
public override void SetMenuData(object param) { string path = param as string; InitializeTopButtons(); SetDiscount(); if (string.IsNullOrEmpty(path)) { path = "mystery"; } var categoryindex = categoryTabs.TabLibPrefabs.FindIndex(tab => tab.GameViewObj != null && path.StartsWith(tab.GameViewObj.name)); if (categoryindex < 0) { EB.Debug.LogWarning("UIStoreController: path {0} not found", path); return; } var entry = categoryTabs.TabLibPrefabs[categoryindex]; categoryTabs.SelectTab(categoryindex); ButtonFlow(categoryTabs.TabLibPrefabs[categoryindex].TabObj.transform.parent); path = path.Replace(entry.GameViewObj.name, "").Trim(new char[] { '/' }); UITabController subTabs = entry.GameViewObj.GetComponentInChildren <UITabController>(); if (subTabs == null) { EB.Debug.LogWarning("UIStoreController: sub tab controller not found"); return; } var subIndex = subTabs.TabLibPrefabs.FindIndex(tab => tab.GameViewObj != null && path.StartsWith(tab.GameViewObj.name)); if (subIndex < 0) { EB.Debug.LogWarning("UIStoreController: sub path {0} not found", path); return; } subTabs.SelectTab(subIndex); }
public override void Awake() { base.Awake(); var t = controller.transform; UIButton backBtn = t.Find("FrameBG/Panel/CancelBtn").GetComponent <UIButton>(); controller.backButton = backBtn; tabController = t.Find("Content/ScrollView/Placeholder/ButtonList").GetComponent <UITabController>(); FirstChargeRP = t.Find("Content/ScrollView/Placeholder/ButtonList/0_shouchong/Btn/RedPoint").gameObject; SevenDayRP = t.Find("Content/ScrollView/Placeholder/ButtonList/1_qiri/Btn/RedPoint").gameObject; GrowUpRP = t.Find("Content/ScrollView/Placeholder/ButtonList/2_chengzhang/Btn/RedPoint").gameObject; LevelAwardRP = t.Find("Content/ScrollView/Placeholder/ButtonList/3_dengji/Btn/RedPoint").gameObject; HeroMedalRP = t.Find("Content/ScrollView/Placeholder/ButtonList/4_yinxiong/Btn/RedPoint").gameObject; DiamondGiftRP = t.Find("Content/ScrollView/Placeholder/ButtonList/5_zuanshi/Btn/RedPoint").gameObject; MainInstanceGiftRP = t.Find("Content/ScrollView/Placeholder/ButtonList/6_zhuxian/Btn/RedPoint").gameObject; progresBar = t.GetComponent <UIProgressBar>("Content/ScrollView/UIScrollBar"); ArrowObj = t.FindEx("Content/Arrow").gameObject; progresBar.onChange.Add(new EventDelegate(OnChange)); }