예제 #1
0
 public TimerLoopNode(int delta, int times, CallbackWithParam callback, object param = null)
 {
     this.delta    = delta;
     this.times    = times;
     this.callback = callback;
     this.param    = param;
 }
예제 #2
0
    public override void onBuild(object arguments)
    {
        var    param = arguments as Hashtable;
        string title = param["title"] as string;
        string tip   = param["tip"] as string;

        m_callback = param["callback"] as CallbackWithParam;

        if (title != null)
        {
            transform.FindChild("BG/Text").GetComponent <Text>().text = title;
        }

        if (tip != null)
        {
            transform.FindChild("BG/InputField/Placeholder").GetComponent <Text>().text = tip;
        }

        m_inputText = transform.FindChild("BG/InputField/Text").GetComponent <Text>();
        transform.FindChild("BG/Button").GetComponent <Button>().onClick.AddListener(close);

        var btnYes = transform.FindChild("BG/BtnYes");

        btnYes.GetComponent <Button>().onClick.AddListener(onClickYes);
    }
예제 #3
0
    public static void callLoopTime(int delta, int times, CallbackWithParam callback, object param = null)
    {
        var node = new TimerLoopNode(delta, times, callback, param);

        node.endTime = delta + Tools.getCurTime();
        m_loopList.AddLast(node);
    }
예제 #4
0
    public override void onBuild(object arguments)
    {
        var param = arguments as Hashtable;

        for (int i = 1; i <= 5; i++)
        {
            m_list.Add(new OptionItem(transform.FindChild("BG/Btn" + i).gameObject, i));
        }

        transform.FindChild("BtnClose").GetComponent <Button>().onClick.AddListener(close);

        if (param == null)
        {
            return;
        }

        m_callback = param["callback"] as CallbackWithParam;

        if (m_callback == null)
        {
            return;
        }

        var list = param["options"] as List <string>;

        for (int i = 0; i < list.Count; i++)
        {
            string str = list[i] as string;
            m_list[i].setInfo(str, onClickOpetion);
            m_list[i].show();
        }
    }
예제 #5
0
    public static void openOption(List <string> options, CallbackWithParam callback)
    {
        Hashtable param = new Hashtable();

        param["options"]  = options;
        param["callback"] = callback;

        new PanelOption(param);
    }
예제 #6
0
    public static void openInput(string title, CallbackWithParam callback, string tip = "")
    {
        Hashtable param = new Hashtable();

        param["title"]    = title;
        param["tip"]      = tip;
        param["callback"] = callback;

        new PanelInput(param);
    }
예제 #7
0
 public TimerNode(long endTime, CallbackWithParam callback, object param = null)
 {
     this.endTime  = endTime;
     this.callback = callback;
     this.param    = param;
 }
예제 #8
0
 /**
  * time 毫秒
  */
 public static void callLaterTime(int time, CallbackWithParam callback, object param = null)
 {
     m_list.AddLast(new TimerNode(time + Tools.getCurTime(), callback, param));
 }
예제 #9
0
 public void setInfo(string text, CallbackWithParam callback)
 {
     m_text.text = text;
     m_callback  = callback;
 }