void onTab(string name) { for (int i = 0; i < Con_view.childCount; i++) { Con_view.GetChild(i).GetComponent <Button>().interactable = true; } Con_view.FindChild(name).GetComponent <Button>().interactable = false; if (CurSport != null && CurSport.sport_Name == name) { return; } foreach (Basesport sp in sport_Dic.Values) { if (sp != null) { sp.sport_Obj.SetActive(false); } } if (!sport_Dic.ContainsKey(name) || sport_Dic[name] == null) { GameObject prefab = null; GameObject panel = null; switch (name) { case "sports_jdzc": prefab = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_a3_sports_jdzc"); panel = GameObject.Instantiate(prefab) as GameObject; sport_Dic[name] = new a3_sports_jdzc(panel.transform, name); break; case "sports_jjc": prefab = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_a3_sports_jjc"); panel = GameObject.Instantiate(prefab) as GameObject; sport_Dic[name] = new a3_sports_jjc(panel.transform, name); break; } panel.transform.SetParent(contents, false); } CurSport?.onClose(); CurSport = sport_Dic[name]; CurSport?.onShowed(); CurSport?.gameObject.SetActive(true); }
public override void init() { sport_Obj.transform.FindChild("myinfo/Text").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jdzc_0"); sport_Obj.transform.FindChild("myinfo/Text1").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jdzc_1"); sport_Obj.transform.FindChild("find/text1").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jdzc_2"); sport_Obj.transform.FindChild("find/text2").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jdzc_3"); sport_Obj.transform.FindChild("Text 2").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jdzc_4"); sport_Obj.transform.FindChild("GetInfo_tab/Text").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jdzc_5"); sport_Obj.transform.FindChild("GetInfo_tab/shuoming/Text").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jdzc_6"); sport_Obj.transform.FindChild("GetInfo_tab/shuoming/Image/Text").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jdzc_7"); sport_Obj.transform.FindChild("GetInfo_tab/tab_top/1/Text").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jjc_14"); sport_Obj.transform.FindChild("GetInfo_tab/tab_top/2/Text").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jjc_15"); sport_Obj.transform.FindChild("GetInfo_tab/tab_top/3/Text").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jjc_16"); sport_Obj.transform.FindChild("GetInfo_tab/tab_top/4/Text").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jjc_17"); sport_Obj.transform.FindChild("Text").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jdzc_7"); sport_Obj.transform.FindChild("tip/text_bg/name/has").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jjc_20"); sport_Obj.transform.FindChild("tip/text_bg/name/lite").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jjc_21"); sport_Obj.transform.FindChild("Finding/back/Text").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jjc_19"); sport_Obj.transform.FindChild("Finding/timetxt").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jdzc_9"); sport_Obj.transform.FindChild("Finding/EstimatedTimetxt").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jdzc_10"); sport_Obj.transform.FindChild("ToSure/timeGo/Text").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jdzc_11"); sport_Obj.transform.FindChild("ToSure/true/Text").GetComponent <Text>().text = ContMgr.getCont("a3_sports_jdzc_12"); _instan = this; header_img = sport_Obj.transform.FindChild("m_rank/rank_text").GetComponent <Image>(); header_icon = sport_Obj.transform.FindChild("m_rank/rank_icon").GetComponent <Image>(); MyScore = sport_Obj.transform.FindChild("myinfo/Score").GetComponent <Text>(); MyRanking = sport_Obj.transform.FindChild("myinfo/ranking").GetComponent <Text>(); tip = sport_Obj.transform.FindChild("tip").gameObject; tosureCon = sport_Obj.transform.FindChild("ToSure").gameObject; findCon = sport_Obj.transform.FindChild("Finding").gameObject; TimeRun = tosureCon.transform.FindChild("timeGo/time").GetComponent <Text>(); Find_Time = findCon.transform.FindChild("Time").GetComponent <Text>(); EstimatedTime = findCon.transform.FindChild("EstimatedTime").GetComponent <Text>(); new BaseButton(this.transform.FindChild("btn_rank")).onClick = (GameObject go) => { InterfaceMgr.getInstance().close(InterfaceMgr.A3_SPORTS); goBack = true; InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_RANK); }; new BaseButton(sport_Obj.transform.FindChild("Get_tab_bt")).onClick = (GameObject go) => { sport_Obj.transform.FindChild("GetInfo_tab").gameObject.SetActive(true); setRewTab(); }; new BaseButton(sport_Obj.transform.FindChild("GetInfo_tab/back")).onClick = (GameObject go) => { sport_Obj.transform.FindChild("GetInfo_tab").gameObject.SetActive(false); }; new BaseButton(sport_Obj.transform.FindChild("find")).onClick = (GameObject go) => { a3_sportsProxy.getInstance().find_game(); }; new BaseButton(sport_Obj.transform.FindChild("Finding/back")).onClick = (GameObject go) => { a3_sportsProxy.getInstance().cancel_game(); }; new BaseButton(sport_Obj.transform.FindChild("ToSure/yes")).onClick = (GameObject go) => { a3_sportsProxy.getInstance().toSure_game(true); }; new BaseButton(sport_Obj.transform.FindChild("ToSure/no")).onClick = (GameObject go) => { a3_sportsProxy.getInstance().toSure_game(false); }; new BaseButton(sport_Obj.transform.FindChild("Get_tab_rank")).onClick = (GameObject go) => { InterfaceMgr.getInstance().close(InterfaceMgr.A3_SPORTS); goBack = true; ArrayList l = new ArrayList(); l.Add(5); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_RANKING, l); }; }