コード例 #1
0
    /**
     * 领奖
     */
    public static void reward(string title, string btText, int gold, string reward, DialogOkAction action)
    {
        rewardTitle.text  = title;
        rewardBtText.text = btText;
        string[] rewardStrs = reward.Split('|');
        //int len = rewardStrs.Length;
        if (gold > 0)
        {
            item1.transform.Find("image").GetComponent <Image>().sprite = ShopItem.getGoldSprite();
            item1.transform.Find("num").GetComponent <Text>().text      = "x" + gold;
            item1.SetActive(true);
            showItem(2, rewardStrs, item2);
            showItem(3, rewardStrs, item3);
            showItem(4, rewardStrs, item4);
        }
        else
        {
            showItem(1, rewardStrs, item1);
            showItem(2, rewardStrs, item2);
            showItem(3, rewardStrs, item3);
            showItem(4, rewardStrs, item4);
        }
        rewardBt.onClick.RemoveAllListeners();
        rewardBt.onClick.AddListener(delegate {
            Sound.playSound(SoundType.Click);
            rewardCanvas.SetActive(false);
            if (action != null)
            {
                action.Invoke();
            }
        });

        rewardCanvas.SetActive(true);
    }
コード例 #2
0
    public static void showWarnDialog(string text, DialogOkAction dialogOkAction, bool hideClose, float deltaX, float deltaY)
    {
        WarnDialogInfo w = new WarnDialogInfo();

        w.text      = text;
        w.okAction  = dialogOkAction;
        w.hideClose = hideClose;
        w.deltaX    = deltaX;
        w.deltaY    = deltaY;
        lock (dialogQueue) {
            dialogQueue.Enqueue(w);
        }
    }
コード例 #3
0
 public static void showWarnDialog(string text, DialogOkAction dialogOkAction)
 {
     showWarnDialog(text, dialogOkAction, false, 0, 0);
 }
コード例 #4
0
 public static void showWarnDialog(string text, DialogOkAction dialogOkAction, bool hideClose)
 {
     showWarnDialog(text, dialogOkAction, hideClose, 0, 0);
 }
コード例 #5
0
    public static int showWaitDialog(string text, int time, AfterWaitAction afterWaitAction, DialogOkAction cancelAction)
    {
        WaitDialogInfo w = new WaitDialogInfo();

        w.text            = text;
        w.time            = time;
        w.afterWaitAction = afterWaitAction;
        w.id           = Interlocked.Increment(ref id);
        w.cancelAction = cancelAction;
        lock (waitDialogQueue) {
            waitDialogQueue.Enqueue(w);
            dialogInfos.Add(w.id, w);
        }
        return(w.id);
    }