public virtual void AddUI(string name, IFreeComponent ui) { if (!uiMap.ContainsKey(name)) { uiMap[name] = new Stack <IFreeComponent>(); } this.uiMap[name].Push(ui); }
private IFreeComponent GetCurrentComponent(IEventArgs args) { IFreeComponent fc = args.ComponentMap.GetUI(name); if (fc != null) { return(fc); } return(component); }
private static string GetAutoString(IFreeComponent fc, IEventArgs args) { IList <string> list = new List <string>(); if (fc.GetAutos(args) != null) { foreach (IFreeUIAuto auto in fc.GetAutos(args)) { list.Add(auto.GetField() + "=" + auto.ToConfig(args)); } } return(StringUtil.GetStringFromStrings(list, "|||")); }
public static FreeUIUtil.Rectangle GetXY(IEventArgs args, IList <IFreeComponent> list, int index, int screenW, int screenH) { IFreeComponent component = list[index]; int x = FreeUtil.ReplaceInt(component.GetX(args), args); int y = FreeUtil.ReplaceInt(component.GetY(args), args); int re = FreeUtil.ReplaceInt(component.GetRelative(args), args); int p = FreeUtil.ReplaceInt(component.GetParent(args), args); if (p == 0) { return(GetXY(0, 0, screenW, screenH, x, y, re)); } else { FreeUIUtil.Rectangle rec = GetXY(args, list, p - 1, screenW, screenH); return(GetXY(rec.x, rec.y, screenW, screenH, x, y, re)); } }
public virtual void TempUseUI(string name, IFreeComponent ui) { AddUI(name, ui); }
public void AddComponent(IFreeComponent component) { this._components.Add(component); component.ToUI().gameObject.transform.SetParent(transform, false); }