private void SelectMap(WidgetCallBack callback) { GameObject CustomScrollPop = Instantiate((GameObject)Resources.Load("Prefabs/UI/CustomScrollPop")); CustomScrollPop.GetComponent <CustomScrollPop>().SetTitle("选择地图"); CustomScrollPop.GetComponent <CustomScrollPop>().HideSubmitBtn(); GameObject ScrollView = CustomScrollPop.GetComponent <CustomScrollPop>().GetScrollView(); string[] path_list = this.map_editor.FindAllMapPath(); GameObject perfab = (GameObject)Resources.Load("Prefabs/UI/CustomButton"); foreach (string path in path_list) { GameObject CustomButton = Instantiate(perfab); CustomButton.GetComponent <CustomButton>().SetLabel(Path.GetFileNameWithoutExtension(path)); CustomButton.GetComponent <CustomButton>().OnClick = delegate { callback(Path.GetFileNameWithoutExtension(path)); this.Canvas.GetComponent <CanvasBase>().RemoveWindow(CustomScrollPop); }; ScrollView.GetComponent <CustomScrollView>().AddItem(CustomButton); } this.Canvas.GetComponent <CanvasBase>().AddWindow(CustomScrollPop); }
public void SetSubmitCallBack(WidgetCallBack callback) { this.SubmitCallBack = callback; }
public virtual void ConnectSignal(string detailedSignal, WidgetCallBack callback, IntPtr data, NativeMethods.GClosureNotify destroyData) { NativeMethods.g_signal_connect_data(Handle, detailedSignal, Marshal.GetFunctionPointerForDelegate(callback), data, destroyData, GConnectFlags.ConnectAfter); }
public void SetCancelCallBack(WidgetCallBack callback) { this.CancelCallBack = callback; }