Exemplo n.º 1
0
 public void InitUIByData(UIDataParent UIDataParent)
 {
     tipContent = (TipData)UIDataParent;
     for (int i = 1; i < transform.childCount; i++)
     {
         transform.GetChild(i).gameObject.SetActive(i == (int)tipContent.tipBtnType + 1);
     }
     transform.GetChild((int)tipContent.tipBtnType + 1).GetChild(0).GetComponent <Text>().text = tipContent.tipStr;
 }
Exemplo n.º 2
0
        public void OpenUITip(TipBtnType tipBtnType, TipConType tipConType, string tipStr,
                              UnityAction EnsureEvent = null, UnityAction CancelEvent = null, PanelLayer panelLayer = PanelLayer.Tip)
        {
            TipData tipData = new TipData();

            tipData.tipBtnType  = tipBtnType;
            tipData.tipConType  = tipConType;
            tipData.EnsureEvent = EnsureEvent;
            tipData.CancelEvent = CancelEvent;
            tipData.tipStr      = tipStr;
            OpenUITip(tipData, panelLayer);
        }
Exemplo n.º 3
0
 public void OpenUITip(TipData tipData, PanelLayer panelLayer = PanelLayer.Tip)
 {
     if (TypeToTipPanel.ContainsKey(tipData.tipConType))
     {
         //已经打开一个同类的Tip,因此是需要刷新
         TypeToTipPanel[tipData.tipConType].RefreshUIByData(tipData);
         UIManager.Instance.ChangePanelLayer(panelLayer, TypeToTipPanel[tipData.tipConType].transform);
     }
     else
     {
         //是需要新打开一个tip
         UITip uiTipPanel = CreateTipPanel <UITip>(100000, UIManager.Instance.GetPanleLayer(panelLayer),
                                                   tipData, true);
         TypeToTipPanel.Add(tipData.tipConType, uiTipPanel);
     }
 }
Exemplo n.º 4
0
 public void InitUIByData(UIDataParent UIDataParent)
 {
     tipContent = (TipData)UIDataParent;
     for (int i = 1; i < transform.childCount; i++)
     {
         transform.GetChild(i).gameObject.SetActive(i == (int)tipContent.tipBtnType + 1);
     }
     transform.GetChild((int)tipContent.tipBtnType + 1).GetChild(0).GetComponent <Text>().text = tipContent.tipStr;
     if (tipContent.EnsureEvent != null)
     {
         OneEnsureBtn.onClick.AddListener(tipContent.EnsureEvent);
         TwoEnsureBtn.onClick.AddListener(tipContent.EnsureEvent);
     }
     if (tipContent.CancelEvent != null)
     {
         TwoCancelBtn.onClick.AddListener(tipContent.CancelEvent);
     }
     gameObject.SetActive(true);
 }
Exemplo n.º 5
0
 protected override void InitUI(UIDataParent UIDataParent = null)
 {
     if (UIDataParent != null)
     {
         tipContent = (TipData)UIDataParent;
     }
     OneEnsureBtn.onClick.AddListener(() =>
     {
         CloseSelf();
     });
     TwoEnsureBtn.onClick.AddListener(() =>
     {
         CloseSelf();
     });
     TwoCancelBtn.onClick.AddListener(() =>
     {
         CloseSelf();
     });
 }