/*
         * 添加一个确认窗口并置顶
         * param:
         * strWord:窗口文本
         * cbOk:确定按钮回调
         * cbCancle:取消按钮回调
         * strBtnOk:确定按钮文本
         * strBtnCancle:取消按钮文本
         */
        public void CreateDoubleCheckWin(
            string strWord,
            AlertCallBack cbOk,
            AlertCallBack cbCancle,
            string strBtnOk  = "确定",
            string strCancle = "取消"
            )
        {
            GameObject g = UnityEngine.Object.Instantiate(prefabAlert_);

            g.layer = LayerMask.NameToLayer(LayerNames.UI);
            UI ui = ComponentFactory.Create <UI, GameObject>(g);

            UIDoubleCheckWin win = ui.AddComponent <UIDoubleCheckWin>();

            GameObjectUtil.SetParentToChild(alertsRoot_, ui.GameObject, false);
            GameObjectUtil.SetZ(ui.GameObject, ZORDER_ALERT);

            win.SetTextContent(strWord);
            win.SetOkCb(cbOk);
            win.SetCancleCb(cbCancle);
            win.SetBtnOkText(strBtnOk);
            win.SetBtnCancleText(strCancle);
            win.SetCloseCallBack(closeWin);
            wins_.Add(ui);
            checkOpenBg();
        }
        //---------------对外接口------------------------------

        /* 添加一个警告窗口 并 置顶
         * param:
         * strWord:窗口文本
         * cb:按钮事件
         * strBtn:按钮文本
         */
        public void CreateAlertWin(
            string strWord,
            AlertCallBack cb,
            string strBtn = "好的"
            )
        {
            GameObject g = UnityEngine.Object.Instantiate(prefabAlert_);

            g.layer = LayerMask.NameToLayer(LayerNames.UI);
            UI ui = ComponentFactory.Create <UI, GameObject>(g);

            UIAlertWin win = ui.AddComponent <UIAlertWin>();

            GameObjectUtil.SetParentToChild(alertsRoot_, ui.GameObject, false);
            GameObjectUtil.SetZ(ui.GameObject, ZORDER_ALERT);

            win.SetTextContent(strWord);
            win.SetCheckCb(cb);
            win.SetCheckBtnText(strBtn);
            win.SetCloseCallBack(closeWin);
            wins_.Add(ui);
            checkOpenBg();
        }
Beispiel #3
0
 /*
  * 设置点击取消的回调
  * param:
  * cb:点击取消的回调
  */
 public void SetCancleCb(AlertCallBack cb)
 {
     cancleCb_ = cb;
 }
Beispiel #4
0
        //----------------对外接口--------------------

        /*
         * 设置check 回调
         * param:
         * cb:check 回调
         */
        public void SetCheckCb(AlertCallBack cb)
        {
            checkCb_ = cb;
        }
Beispiel #5
0
        //----------------对外接口-----------------

        /*
         * 设置点击确定的回调
         * param:
         * cb:点击确定的回调
         */
        public void SetOkCb(AlertCallBack cb)
        {
            okCb_ = cb;
        }