Example #1
0
 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;
 }
Example #2
0
 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)));
 }
Example #3
0
    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);
        }
    }
Example #4
0
 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);
         }
     }
 }
Example #5
0
    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);
    }