public void SetStyles(IStyleLib styleLib, TrackerController mainController) { mainC = mainController; styleLib.SetStyle(ListFiles); styleLib.SetStyle(ListDirectories); styleLib.SetStyle(ListPlaces); styleLib.SetStyle(ButtonAddFolder, BtnNumber.AddFolder); styleLib.SetStyle(ButtonAddSubFolder, BtnNumber.AddSubFolder); styleLib.SetStyle(ButtonAddSelected, BtnNumber.AddFile); styleLib.SetStyle(ButtonFilterVideo, "video"); styleLib.SetStyle(ButtonFilterMusic, "audio"); styleLib.SetStyle(ButtonFilterPictures, "image"); styleLib.SetStyle(ButtonFilterPlaylist, "playlist"); styleLib.SetStyle(ButtonFilterStream, "stream"); styleLib.SetStyle(ButtonClearPlaylist, BtnNumber.ClearList); styleLib.SetStyle(ButtonClosePanel, BtnNumber.Close); styleLib.SetStyle(ButtonMaximizePanel, BtnNumber.Maximize); styleLib.SetStyle(ButtonRefresh, BtnNumber.Refresh); styleLib.SetStyle(ButtonSort, "Name"); ButtonSort.SetContent("Date", 1); Background = styleLib.GetGridBrush(false); styleLib.SetStyle(TextBoxFind); LabelTopic.Background = styleLib.GetGridBrush(true); LabelTopic.Foreground = styleLib.GetForeground(); }
//当按钮按下触发事件 /// <summary> /// 按钮 按下事件 /// </summary> /// <param name="eventData"> 传递 GameObject</param> private void PointerDowkEvent(GameObject eventData) { GameObject tmpPress = GetButtonComponent(NAME_PRESS); Debug.Log("dddddddddd"); if (tmpPress != null) { buttonState = ButtonSort.State_press; tmpPress.SetActive(true); GetButtonComponent(NAME_DEFAULT).SetActive(false); if (IsDownEvent) { ////播放特效 //GameObject tmpEffect = GetButtonComponent(NAME_EFFECT); //if (tmpEffect != null) //{ // //关闭特效 // isUishow(tmpEffect, false); // //发送消息 // MsgBase.SendMsg(m_ButtonMsg); // return; //} if (gameObject.tag == "HomePage") { MsgBase.SendMsg <string>(m_ButtonMsg, gameObject.name); } MsgBase.SendMsg(m_ButtonMsg); return; } } }
/// <summary> /// //当按钮抬起触发事件 /// </summary> /// <param name="eventData"> 传递 GameObject </param> private void CallbackEvent(GameObject eventData) { if (IsDownEvent) { return; } GameObject tmpPress = GetButtonComponent(NAME_PRESS); if (tmpPress != null && tmpPress.activeSelf) { buttonState = ButtonSort.State_default; tmpPress.SetActive(false); GetButtonComponent(NAME_DEFAULT).SetActive(true); } GameObject tmpHintObj = GetButtonComponent(NAME_HINT); if (tmpHintObj != null) { //关闭提醒 isUishow(tmpHintObj, false); } //播放特效 GameObject tmpEffect = GetButtonComponent(NAME_EFFECT); if (tmpEffect != null) { //打开特效 isUishow(tmpEffect, true); Invoke("Click", m_EffectTime); return; } Click(); }
/// <summary> /// 设置 是否显示 Lose /// </summary> /// <param name="_isLose"> _isLose 由于 isLose 传递</param> public void SetLose(bool _isLose) { m_button = gameObject.GetComponent <Button>(); if (_isLose) { m_button.enabled = false; GetComponent <EventTriggerListener>().enabled = false; buttonState = ButtonSort.State_lose; foreach (var tmp in m_ButtonDictionary) { tmp.Value.SetActive(false); if (tmp.Key == NAME_LOSE || tmp.Key == NAME_TEXT) { tmp.Value.SetActive(true); } } } else { //显示按钮 buttonState = ButtonSort.State_default; foreach (var tmp in m_ButtonDictionary) { tmp.Value.SetActive(false); if (tmp.Key == NAME_DEFAULT || tmp.Key == NAME_TEXT) { tmp.Value.SetActive(true); } } //打开按钮事件 m_button.enabled = true; GetComponent <EventTriggerListener>().enabled = true; } }
private void ExitEvent(GameObject go) { buttonState = ButtonSort.State_default; foreach (var tmp in m_ButtonDictionary) { tmp.Value.SetActive(false); if (tmp.Key == NAME_DEFAULT || tmp.Key == NAME_TEXT) { tmp.Value.SetActive(true); } } }
public override void Init(SceneManager sceneManager) { base.Init(sceneManager); m_ButtonBack.onClick.AddListener(ButtonBackClicked); _CountrySelectedList = new List <CountryInfoRow>(); Close(true); m_ButtonSortArea.onClick.AddListener(SortAreaButtonClicked); _ButtonSortArea = m_ButtonSortArea.GetComponent <ButtonSort>(); m_ButtonSortGDP.onClick.AddListener(SortGDPButtonClicked); _ButtonSortGDP = m_ButtonSortGDP.GetComponent <ButtonSort>(); m_ButtonSortPopulation.onClick.AddListener(SortPopulationButtonClicked); _ButtonSortPopulation = m_ButtonSortPopulation.GetComponent <ButtonSort>(); }