コード例 #1
0
    public void setBtn2(string name, OnButtonCallBack callBack)
    {
        _btn2Callback = callBack;
        replenishBtn  = transform.FindChild("replenish").gameObject.GetComponent <Button>();
        Text text = replenishBtn.transform.FindChild("Text").GetComponent <Text>();

        text.text = name;
    }
コード例 #2
0
    public void setBtn1(string name, OnButtonCallBack callBack)
    {
        _btn1Callback = callBack;
        unlockingBtn  = transform.FindChild("unlocking").gameObject.GetComponent <Button>();
        Text text = unlockingBtn.transform.FindChild("Text").GetComponent <Text>();

        text.text = name;
    }
コード例 #3
0
        public static GameObject OpenTips(TipsType type, string title, OnButtonCallBack okCallBack = null, OnButtonCallBack cancelCallBack = null, OnButtonCallBack closeCallBack = null, float delayTime = 0)
        {
            GameObject go          = Libs.Resource.UIManager.OpenUI(Config.UI.UIPath.TipsPanel);
            CommonTips common_tips = go.GetComponent <CommonTips>();

            if (type == TipsType.OK_CANCEL)
            {
                common_tips.btn_ok.gameObject.SetActive(true);
                common_tips.btn_cancel.gameObject.SetActive(true);

                common_tips.btn_ok.GetComponent <RectTransform>().localPosition     = new Vector3(150, -100, 0);
                common_tips.btn_cancel.GetComponent <RectTransform>().localPosition = new Vector3(-150, -100, 0);
            }
            else if (type == TipsType.OK)
            {
                common_tips.btn_cancel.gameObject.SetActive(false);
                common_tips.btn_ok.gameObject.SetActive(true);

                common_tips.btn_ok.GetComponent <RectTransform>().localPosition = new Vector3(0, -100, 0);
            }
            else if (type == TipsType.AUTO_CLOSE)
            {
                common_tips.btn_cancel.gameObject.SetActive(false);
                common_tips.btn_ok.gameObject.SetActive(false);

                if (delayTime > 0)
                {
                    common_tips.m_closeTime = Time.time + delayTime;
                }
            }

            common_tips.m_okCallBack     = okCallBack;
            common_tips.m_cancelCallBack = cancelCallBack;
            common_tips.m_closeCallBack  = closeCallBack;

            common_tips.tips_text.text = title;

            return(go);
        }
コード例 #4
0
ファイル: GameView.cs プロジェクト: Janady/xunamaStick
 public void setupCallback(OnButtonCallBack tryCallback, OnButtonCallBack playCallback, OnButtonCallBack buyCallback)
 {
     this.tryCallback  = tryCallback;
     this.buyCallback  = buyCallback;
     this.playCallback = playCallback;
 }