示例#1
0
 private void CbAccept_CheckedChanged(object sender, EventArgs e)
 {
     if (CbAccept.Checked)
     {
         BtnYes.Enabled = true;
         _ = BtnYes.Focus();
     }
     else
     {
         BtnYes.Enabled = false;
         _ = BtnNo.Visible ? BtnNo.Focus() : BtnCancel.Focus();
     }
 }
示例#2
0
        private void ShowButton()
        {
            if (mData.BtnTexts == null || mData.BtnTexts.Length < 1)
            {
                return;
            }

            if (mData.BtnTexts.Length == 1)
            {
                BtnNo.gameObject.SetActive(false);
                BtnYes.gameObject.SetActive(false);
                BtnOK.gameObject.SetActive(true);

                OKText.text = mData.BtnTexts[0];
            }
            else if (mData.BtnTexts.Length == 2)
            {
                BtnNo.gameObject.SetActive(true);
                BtnYes.gameObject.SetActive(true);
                BtnOK.gameObject.SetActive(false);

                YesText.text = mData.BtnTexts[0];
                NoText.text  = mData.BtnTexts[1];
            }

            if (mData.BtnBgImgs == null || mData.BtnBgImgs.Length < 1)
            {
                return;
            }

            if (mData.BtnBgImgs.Length == 1)
            {
                BtnOK.GetComponent <Image>().sprite = mData.BtnBgImgs[0];
            }
            else if (mData.BtnBgImgs.Length == 2)
            {
                BtnYes.GetComponent <Image>().sprite = mData.BtnBgImgs[0];
                BtnNo.GetComponent <Image>().sprite  = mData.BtnBgImgs[1];
            }
        }
示例#3
0
 void Start()
 {
     notication = GameObject.Find("NotiFyLoad").GetComponent <Notify>();
     foreach (var item in notication.Notication.NotifyDbList)
     {
         if (PublicClass.indexNotify == item.Id)
         {
             if (item.Type == 1)
             {
                 BtnYes.GetComponentInChildren <Text>().text = "Yes";
                 BtnNo.GetComponentInChildren <Text>().text  = "No";
                 BtnYes.onClick.AddListener(Yes);
                 BtnNo.onClick.AddListener(No);
             }
             if (item.Type == 2)
             {
                 BtnNo.GetComponentInChildren <Text>().text = "Ok";
                 Destroy(BtnYes.gameObject);
                 BtnNo.onClick.AddListener(No);
             }
             if (item.Type == 3)
             {
                 BtnNo.GetComponentInChildren <Text>().text = "Ok";
                 Destroy(BtnYes.gameObject);
                 BtnNo.onClick.AddListener(Ok);
             }
             if (item.Type == 4)
             {
                 BtnNo.GetComponentInChildren <Text>().text = "Ok";
                 Destroy(BtnYes.gameObject);
                 BtnNo.onClick.AddListener(Ok);
                 Content.text = PublicClass.stringNotify;
                 break;
             }
             Content.text = item.Content;
             break;
         }
     }
 }