void Initialtems()
        {
            int c = max_count;

            for (int i = 0; i < c; i++)
            {
                if (i >= Items.Count)
                {
                    ModelElement mod = new ModelElement();
                    mod.Load(ItemMod.ModData);
                    mod.SetParent(View);
                    mod.data.localScale = new Vector3(1, 1, 1);
                    mod.IsChanged       = true;
                    Item a = new Item();
                    a.target = mod;
                    Items.Add(a);
                }
            }
            for (int i = Items.Count - 1; i >= c; i--)
            {
                var g = Items[i];
                Items.RemoveAt(i);
                ModelManagerUI.RecycleElement(g.target);
            }
        }
 /// <summary>
 /// 释放某个标签和其内容,其对象会被回收
 /// </summary>
 /// <param name="table"></param>
 public void ReleseContent(TableContent table)
 {
     contents.Remove(table);
     table.Content.SetParent(null);
     table.Item.SetParent(null);
     ModelManagerUI.RecycleElement(table.Content);
     ModelManagerUI.RecycleElement(table.Item);
 }
示例#3
0
 void CloseClick(EventCallBack eventCall, UserAction action)
 {
     Head.SetParent(null);
     ModelManagerUI.RecycleElement(Head);
     model.SetParent(null);
     ModelManagerUI.RecycleElement(model);
     auxiliary.RemoveContent(this);
     auxiliary.panel.IsChanged = true;
 }
        public void SetTailUpdate <T, U>(Action <T, U, int> action) where T : class, new()
        {
            for (int i = 0; i < Tails.Count; i++)
            {
                ModelManagerUI.RecycleElement(Tails[i].target);
            }
            Tails.Clear();
            var m = new Middleware <T, U>();

            m.Invoke    = action;
            TailCreator = m;
        }
 public void Clear()
 {
     for (int i = 0; i < items.Count; i++)
     {
         ModelManagerUI.RecycleElement(items[i].main);
     }
     items.Clear();
     point = 0;
     start = 0;
     end   = 0;
     ch    = 0;
     datas.Clear();
 }
示例#6
0
 public override void Dispose()
 {
     if (pops != null)
     {
         for (int i = 0; i < pops.Count; i++)
         {
             pops[i].Dispose();
         }
     }
     pops.Clear();
     ModelManagerUI.RecycleElement(model);
     ClearUI();
 }
 public void Dispose()
 {
     for (int i = 0; i < Titles.Count; i++)
     {
         ModelManagerUI.RecycleElement(Titles[i].target);
     }
     for (int i = 0; i < Items.Count; i++)
     {
         ModelManagerUI.RecycleElement(Items[i].target);
     }
     Titles.Clear();
     Items.Clear();
 }
        void Order()
        {
            float vy = View.data.sizeDelta.y;
            int   c  = items.Count - 1;
            int   ss = 0;

            for (int i = c; i >= 0; i--)
            {
                var   item = items[i];
                float sy   = item.offset;
                float ey   = sy + item.high;
                if (sy - point > vy)
                {
                    ModelManagerUI.RecycleElement(item.main);
                    items.RemoveAt(i);
                }
                else if (ey < point)
                {
                    ModelManagerUI.RecycleElement(item.main);
                    items.RemoveAt(i);
                }
                else
                {
                    float oy = 0.5f * vy - sy + point;
                    item.pos.y = oy;
                    item.main.data.localPosition = new Vector3(0, oy, 0);
                    item.main.IsChanged          = true;
                    ss = item.Index;
                }
            }
            ss -= 10;
            if (ss < 0)
            {
                ss = 0;
            }
            float over = point + vy;

            for (; ss < datas.Count; ss++)
            {
                var item = datas[ss];
                if (item.offset > over)
                {
                    break;
                }
                if (item.offset + item.high > point)
                {
                    UpdateItem(item, ss);
                }
            }
        }
        public void SetTailUpdate(Action <object, object, int> action, Func <ModelElement, object> reflect)
        {
            for (int i = 0; i < Items.Count; i++)
            {
                ModelManagerUI.RecycleElement(Items[i].target);
            }
            Tails.Clear();
            var m = new Middleware <ModelElement, object>();

            m.Update    = action;
            m.hotfix    = true;
            m.reflect   = reflect;
            TailCreator = m;
        }
示例#10
0
 public void Dispose()
 {
     if (Left.realLine | Right.realLine | Top.realLine | Down.realLine)
     {
         Left.Right.Remove(this);
         Right.Left.Remove(this);
         Top.Down.Remove(this);
         Down.Top.Remove(this);
         model.SetParent(null);
         MergeArea();
         ModelManagerUI.RecycleElement(model);
         layout.areas.Remove(this);
     }
 }
示例#11
0
 public void Dispose()
 {
     if (LineStart != null)
     {
         LineStart.AdjacentLines.Remove(this);
     }
     if (LineEnd != null)
     {
         LineEnd.AdjacentLines.Remove(this);
     }
     layout.lines.Remove(this);
     model.SetParent(null);
     ModelManagerUI.RecycleElement(model);
 }
示例#12
0
 public virtual void Dispose()
 {
     if (model != null)
     {
         ModelManagerUI.RecycleElement(model);
     }
     point--;
     if (buff[point] != null)
     {
         buff[point].Index = Index;
     }
     buff[Index] = buff[point];
     buff[point] = null;
 }
 public void Clear()
 {
     for (int i = 0; i < Items.Count; i++)
     {
         var g = Items[i];
         ModelManagerUI.RecycleElement(g.target);
     }
     for (int i = 0; i < Recycler.Count; i++)
     {
         var g = Recycler[i];
         ModelManagerUI.RecycleElement(g.target);
     }
     Items.Clear();
     Recycler.Clear();
 }
 public void Dispose()
 {
     for (int i = 0; i < Titles.Count; i++)
     {
         ModelManagerUI.RecycleElement(Titles[i].target);
     }
     for (int i = 0; i < Items.Count; i++)
     {
         ModelManagerUI.RecycleElement(Items[i].target);
     }
     for (int i = 0; i < Tails.Count; i++)
     {
         ModelManagerUI.RecycleElement(Tails[i].target);
     }
     Titles.Clear();
     Items.Clear();
     Tails.Clear();
     UIAnimation.Manage.ReleaseAnimat(this);
 }