public TimerLoopNode(int delta, int times, CallbackWithParam callback, object param = null) { this.delta = delta; this.times = times; this.callback = callback; this.param = param; }
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); }
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); }
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(); } }
public static void openOption(List <string> options, CallbackWithParam callback) { Hashtable param = new Hashtable(); param["options"] = options; param["callback"] = callback; new PanelOption(param); }
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); }
public TimerNode(long endTime, CallbackWithParam callback, object param = null) { this.endTime = endTime; this.callback = callback; this.param = param; }
/** * time 毫秒 */ public static void callLaterTime(int time, CallbackWithParam callback, object param = null) { m_list.AddLast(new TimerNode(time + Tools.getCurTime(), callback, param)); }
public void setInfo(string text, CallbackWithParam callback) { m_text.text = text; m_callback = callback; }