public HotConstructor(Action <T, U, int> action) { middle = new HotMiddleware(); middle.Context = this; middle.initializer = new UIInitializer(HotUIBase.ObjectFields(typeof(T))); middle.creator = Create; middle.caller = Call; Invoke = action; }
public HotUILinker(UIContainer container, string mod) { con = container; model = HGUIManager.FindChild(container.model, mod); middle = new ObjectLinker(container); middle.ItemUpdate = MItemUpdate; middle.CalculItemHigh = MCalculItemHigh; middle.ItemCreate = MItemCreate; initializer = new UIInitializer(HotUIBase.ObjectFields(typeof(T))); }
public virtual void Show(HotUIBase context, Vector2 pos, object obj = null) { Context = context; var mod = model; if (mod != null) { //mod.data.localPosition = Dock(pos,mod.data.sizeDelta); } }
public virtual void Initial(Transform parent, HotUIBase ui, object obj = null) { DataContext = obj; UIParent = ui; Parent = parent; if (parent != null) { if (Main != null) { Main.transform.SetParent(parent); } } }
public T ShowMenu <T>(HotUIBase context, Vector2 pos, object obj = null) where T : HotMenuWindow, new() { if (currentPop != null) { currentPop.Hide(); currentPop = null; } for (int i = 0; i < pops.Count; i++) { if (pops[i] is T) { currentPop = pops[i]; pops[i].Show(context, pos, obj); return(pops[i] as T); } } var t = new T(); pops.Add(t); currentPop = t; t.Initial(Root, context, obj); t.Show(context, pos, obj); t.ReSize(); return(t); }