Beispiel #1
0
    public static void confirm(string tip, EventDelegate sure, EventDelegate cancle)
    {
        if (currentConfirm != null)
        {
            return;
        }
        currentConfirm = GameObject.Find("pops").transform.FindChild("confirm").gameObject;
        currentConfirm.SetActive(true);
        UILabel label = currentConfirm.transform.FindChild("label-con").gameObject.GetComponent <UILabel>();

        label.text = tip;
        UIButton button = currentConfirm.transform.FindChild("sure-con").gameObject.GetComponent <UIButton>();

        button.onClick.Clear();
        button.onClick.Add(sure);
        button = currentConfirm.transform.FindChild("cancle-con").gameObject.GetComponent <UIButton>();
        button.onClick.Clear();
        button.onClick.Add(cancle);
        CameraUtil.push(1, 3);
        Transform trans_base = currentConfirm.transform.parent.parent;

        for (int i = 0; i < trans_base.childCount; i++)
        {
            Transform sun = trans_base.GetChild(i);
            if (!sun.Equals(currentConfirm.transform.parent))
            {
                MyUtilTools.changeAlpha(0.2f, sun.gameObject);
            }
        }
    }
Beispiel #2
0
    public static void tip(string str, bool flag = false, EventDelegate doSomthing = null)
    {
        if (currentTip == null)
        {
            currentTip = GameObject.Find("pops").transform.FindChild("tip").gameObject;
            currentTip.SetActive(true);
        }
        UILabel label = currentTip.transform.FindChild("label-tip").gameObject.GetComponent <UILabel>();

        label.text = str;
        if (!currentTip.activeSelf)
        {
            currentTip.SetActive(true);
        }
        UISprite sprite = currentTip.transform.FindChild("flag").gameObject.GetComponent <UISprite>();

        sprite.spriteName = flag ? "Checkmark" : "X Mark";
        Transform trans_base = currentTip.transform.parent.parent;

        for (int i = 0; i < trans_base.childCount; i++)
        {
            Transform sun = trans_base.GetChild(i);
            if (!sun.Equals(currentTip.transform.parent))
            {
                MyUtilTools.changeAlpha(0.2f, sun.gameObject);
            }
        }
        CameraUtil.push(2, 3);
        if (doSomthing != null)
        {
            currentTip.GetComponent <DialogUtil>().needDoSmoething = doSomthing;
        }
    }
Beispiel #3
0
 void tryToClosePush()
 {
     CameraUtil.pop(6);
     foreach (GameObject obj in others)
     {
         MyUtilTools.changeAlpha(1, obj);
     }
     transform.FindChild("base").gameObject.SetActive(false);
     isOpen = false;
 }
Beispiel #4
0
 void tryToOpenPush()
 {
     isOpen = true;
     CameraUtil.push(6, 1);
     foreach (GameObject obj in others)
     {
         MyUtilTools.changeAlpha(0.2f, obj);
     }
     transform.FindChild("base").gameObject.SetActive(true);
     refresh();
 }
Beispiel #5
0
    void dispear()
    {
        count = 0;
        currentLoad.SetActive(false);
        CameraUtil.pop(0);
        Transform trans_base = transform.parent.parent;

        for (int i = 0; i < trans_base.childCount; i++)
        {
            Transform sun = trans_base.GetChild(i);
            if (!sun.Equals(transform.parent))
            {
                MyUtilTools.changeAlpha(1f, sun.gameObject);
            }
        }
        currentLoad = null;
    }
Beispiel #6
0
 public static void TryToDispear()
 {
     if (currentConfirm != null)
     {
         currentConfirm.transform.FindChild("sure-con").gameObject.GetComponent <UIButton>().onClick.Clear();
         currentConfirm.transform.FindChild("cancle-con").gameObject.GetComponent <UIButton>().onClick.Clear();
         currentConfirm.SetActive(false);
         Transform trans_base = currentConfirm.transform.parent.parent;
         for (int i = 0; i < trans_base.childCount; i++)
         {
             Transform sun = trans_base.GetChild(i);
             if (!sun.Equals(currentConfirm.transform.parent))
             {
                 MyUtilTools.changeAlpha(1f, sun.gameObject);
             }
         }
         CameraUtil.pop(1);
         currentConfirm = null;
     }
 }
Beispiel #7
0
    void appear(string showStr)
    {
        gameObject.SetActive(true);
        count = 2000;
        if (tips == null)
        {
            tips = transform.FindChild("tips").GetComponent <UILabel>();
        }
        tips.text = showStr;
        CameraUtil.push(0, 3);
        Transform trans_base = transform.parent.parent;

        for (int i = 0; i < trans_base.childCount; i++)
        {
            Transform sun = trans_base.GetChild(i);
            if (!sun.Equals(transform.parent))
            {
                MyUtilTools.changeAlpha(0.2f, sun.gameObject);
            }
        }
    }
Beispiel #8
0
    public void close()
    {
        gameObject.SetActive(false);
        CameraUtil.pop(2);
        Transform trans_base = currentTip.transform.parent.parent;

        for (int i = 0; i < trans_base.childCount; i++)
        {
            Transform sun = trans_base.GetChild(i);
            if (!sun.Equals(currentTip.transform.parent))
            {
                MyUtilTools.changeAlpha(1f, sun.gameObject);
            }
        }
        currentTip = null;
        if (needDoSmoething != null)
        {
            needDoSmoething.Execute();
            needDoSmoething = null;
        }
    }