void OnReloadItem(int e, object[] p) { string graphName = (string)p[0]; var item = (PuzzleItem)scrollview.GetChild(graphName); if (null != item) { item.Load(); } }
void OnReloadItem(int e, object[] p) { UpdateItems(); string graphName = (string)p[0]; var item = (PuzzleItem)scrollview.GetChild(graphName); if (null != item) { item.Load(); scrollview.SetChildIndex(item, 0); } }
private void Scorll_Change() { // Log.debug (list.scrollPane.posY.ToString () + "|" + list.scrollPane.contentHeight.ToString ()); // try{ float yy = list.scrollPane.posY; float hh = list.scrollPane.contentHeight; float listH = list.viewHeight; //391 int begin = -1; // = (int)Math.Round (yy / hh); int end = 0; GObject o; float oh = 0; List <int> show = new List <int>(); for (int i = 0; i < ld.Count; i++) { o = list.GetChild(i + ""); //_isRed if (o != null) { show.Add(i); } // o = list.GetChildAt (i); // o = list.GetChildAt (i); // if (o == null) // break; // if (o.y < yy) // continue; // else // { // if (begin == -1) // begin = i; // oh = o.y - yy; // } // oh += o.height + list.lineGap; // if (oh >= listH) // { // end = i; // break; // } } begin = show.Count > 0 ? show [0] : -1; end = show.Count > 0 ? show [show.Count - 1] : 0; chatModel.GetRedCountIndexAll(begin, end); RED_CHATUPDATE(null); // }catch(Exception exc){ // // } }
/// <summary> /// /// </summary> /// <param name="name"></param> /// <param name="caption"></param> public void SetItemText(string name, string caption) { GButton item = _list.GetChild(name).asButton; item.title = caption; }
void Start() { UIPanel panel = gameObject.GetComponent <UIPanel>(); GComponent view = panel.ui; // 整个UI的集合 GButton StoryButton = view.GetChild("StoryButton").asButton; StoryButton.onClick.Add(StoryButton_Click); m_story = view.GetChild("Story").asGroup; GComponent storyMask = view.GetChild("StoryMask").asCom; storyMask.onClick.Add(storyMask_Click); GLabel chapter1 = view.GetChild("Chapter1").asLabel; chapter1.onClick.Add(Chapter_Click1); GLabel chapter2 = view.GetChild("Chapter2").asLabel; chapter2.onClick.Add(Chapter_Click2); GLabel chapter3 = view.GetChild("Chapter3").asLabel; chapter3.onClick.Add(Chapter_Click3); GLabel chapter4 = view.GetChild("Chapter4").asLabel; chapter4.onClick.Add(Chapter_Click4); GLabel chapter5 = view.GetChild("Chapter5").asLabel; chapter5.onClick.Add(Chapter_Click5); GButton HistoryButton = view.GetChild("HistoryButton").asButton; HistoryButton.onClick.Add(HistoryButton_Click); GComponent ListMask = view.GetChild("ListMask").asCom; ListMask.onClick.Add(ListMask_Click); m_personList = view.GetChild("PersonList").asGroup; GList list = view.GetChild("List").asList; GComponent Taoxi = list.GetChild("Taoxi").asCom; Taoxi.onClick.Add(Taoxi_Click); GComponent Lee = list.GetChild("Lee").asCom; Lee.onClick.Add(Lee_Click); GComponent Grandpa = list.GetChild("Grandpa").asCom; Grandpa.onClick.Add(Grandpa_Click); GComponent Grace = list.GetChild("Grace").asCom; Grace.onClick.Add(Grace_Click); GComponent CURE = list.GetChild("CURE").asCom; CURE.onClick.Add(CURE_Click); TaoxiView = view.GetChild("Taoxi").asGroup; TaoxiView.onClick.Add(Taoxi_Click); LeeView = view.GetChild("Lee").asGroup; LeeView.onClick.Add(Lee_Click); GrandpaView = view.GetChild("Grandpa").asGroup; GrandpaView.onClick.Add(Grandpa_Click); GraceView = view.GetChild("Grace").asGroup; GraceView.onClick.Add(Grace_Click); CUREView = view.GetChild("CURE").asGroup; CUREView.onClick.Add(CURE_Click); GButton ClueButton = view.GetChild("ClueButton").asButton; ClueButton.onClick.Add(ClueButton_Click); m_clue = view.GetChild("Clue").asGroup; m_clueCaption = view.GetChild("ClueCaption").asLabel; m_clueContent = view.GetChild("ClueContent").asLabel; GButton rightButton = view.GetChild("RightButton").asButton; rightButton.onClick.Add(rightButton_Click); GButton leftButton = view.GetChild("LeftButton").asButton; leftButton.onClick.Add(leftButton_Click); GComponent clueMask = view.GetChild("ClueMask").asCom; clueMask.onClick.Add(clueMask_Click); }
void initClueList() { UIPanel panel = gameObject.GetComponent <UIPanel>(); GComponent view = panel.ui; // 整个UI的集合 GList clueList = view.GetChild("ClueList").asList; GLabel clueUse = clueList.GetChild("ClueUse").asLabel; GButton clueUseButton = clueUse.GetChild("Button").asButton; clueUseButton.onClick.Add(Use_Click); int isClueUse = PlayerPrefs.GetInt("isClueUse"); if (isClueUse == 0) { clueUse.visible = false; } else { clueUse.visible = true; } GLabel clueGPS = clueList.GetChild("ClueGPS").asLabel; GButton clueGPSButton = clueGPS.GetChild("Button").asButton; clueGPSButton.onClick.Add(GPS_Click); int isClueGPS = PlayerPrefs.GetInt("isClueGPS"); if (isClueGPS == 0) { clueGPS.visible = false; } else { clueGPS.visible = true; } GLabel clueShelf = clueList.GetChild("ClueShelf").asLabel; GButton clueShelfButton = clueShelf.GetChild("Button").asButton; clueShelfButton.onClick.Add(shelf_Click); int isClueShelf = PlayerPrefs.GetInt("isClueShelf"); if (isClueShelf == 0) { clueShelf.visible = false; } else { clueShelf.visible = true; } GLabel cluePicture = clueList.GetChild("CluePicture").asLabel; GButton cluePictureButton = cluePicture.GetChild("Button").asButton; cluePictureButton.onClick.Add(picture_Click); int isCluePicture = PlayerPrefs.GetInt("isCluePicture"); if (isCluePicture == 0) { cluePicture.visible = false; } else { cluePicture.visible = true; } }
void initClueList() { UIPanel panel = gameObject.GetComponent <UIPanel>(); GComponent view = panel.ui; // 整个UI的集合 GList clueList = view.GetChild("ClueList").asList; GLabel clueMap = clueList.GetChild("ClueMap").asLabel; GButton clueMapButton = clueMap.GetChild("Button").asButton; clueMapButton.onClick.Add(map_Click); int isClueMap = PlayerPrefs.GetInt("isClueMap"); if (isClueMap == 0) { clueMap.visible = false; } else { clueMap.visible = true; } GLabel clueBrain = clueList.GetChild("ClueBrain").asLabel; GButton clueBrainButton = clueBrain.GetChild("Button").asButton; clueBrainButton.onClick.Add(brain_Click); int isClueBrain = PlayerPrefs.GetInt("isClueBrain"); if (isClueBrain == 0) { clueBrain.visible = false; } else { clueBrain.visible = true; } GLabel clueBall = clueList.GetChild("ClueBall").asLabel; GButton clueBallButton = clueBall.GetChild("Button").asButton; clueBallButton.onClick.Add(ball_Click); int isClueBall = PlayerPrefs.GetInt("isClueBall"); if (isClueBall == 0) { clueBall.visible = false; } else { clueBall.visible = true; } GLabel clueDesk = clueList.GetChild("ClueDesk").asLabel; GButton clueDeskButton = clueDesk.GetChild("Button").asButton; clueDeskButton.onClick.Add(desk_Click); int isClueDesk = PlayerPrefs.GetInt("isClueDesk"); if (isClueDesk == 0) { clueDesk.visible = false; } else { clueDesk.visible = true; } }