Пример #1
0
    private static GameObject Show(string message, string title, GameObject parentGO, GameObject receiverGO, bool isSingle, string okStr, OnOK okFun, string cancelStr, OnCancel cancelFun, string checkStr = "", int bgClickType = 0, DirectionPostion align = DirectionPostion.Center)
    {
        GameObject prefab = ResourceManager.Instance.LoadExistsAsset <GameObject>("Prefab/UI/TipAlter/AlertBox");

        if (parentGO == null)
        {
            parentGO = UIManager.TipLayer.gameObject;
        }

        GameObject obj3 = UGUITools.AddChild(parentGO, prefab);

        Util.SetLayer(obj3, parentGO.layer);
        AlertBox component = obj3.AddMissingComponent <AlertBox>();

        if (string.IsNullOrEmpty(title))
        {
            title = "提示";
        }
        if (string.IsNullOrEmpty(okStr))
        {
            okStr = "确定";
        }
        if (string.IsNullOrEmpty(cancelStr))
        {
            cancelStr = "取消";
        }
        // 默认都是enable
        component.InitSetCommon(title, message, bgClickType, okStr, cancelStr, isSingle);
        component.mOnOK     = okFun;
        component.mOnCancel = cancelFun;

        if (!string.IsNullOrEmpty(checkStr))
        {
            component.AddSetCheckBoxInfo(checkStr);
        }

        return(obj3);
    }
Пример #2
0
 private static GameObject ShowSingleBtn(string message, string title, GameObject parent, GameObject receiverGO, string btnStr, OnOK btnFun, DirectionPostion align)
 {
     return(Show(message, title, parent, receiverGO, true, btnStr, btnFun, null, null, "", 0, align));
 }
Пример #3
0
 public static GameObject Show(string message, GameObject parent, OnOK ok, OnCancel cancel, string okStr, string cancelStr, string checkStr = "", int bgClickType = 0, float maskAlpha = 0f, DirectionPostion pivot = DirectionPostion.Center)
 {
     return(Show(message, null, parent, null, false, okStr, ok, cancelStr, cancel, checkStr, bgClickType, pivot));
 }
Пример #4
0
 public static GameObject ShowSingleBtn(string message, string title, GameObject parent, DirectionPostion align)
 {
     return(ShowSingleBtn(message, title, parent, null, null, null, align));
 }