public void Remove(StackBox thing)
 {
     if (Items.Contains(thing))
     {
         Items.Remove(thing);
     }
     RaiseEvent();
 }
Exemple #2
0
        public BoxView(StackBox.Direction direction, params View?[] children)
        {
            _box = new StackBox(10, direction);

            foreach (var c in children)
            {
                if (c != null)
                {
                    _box.AddChild(c.GetNode());
                }
            }
        }
    public void Add(StackBox thing)
    {
        if (thing == null)
        {
            return;
        }
        if (!Items.Contains(thing))
        {
            Items.Add(thing);
        }

        RaiseEvent();
    }
Exemple #4
0
 private void SetupPool()
 {
     if (prefab != null)
     {
         int size = 30;
         for (int i = 0; i < size; ++i)
         {
             StackBox box = Instantiate(prefab);
             box.gameObject.SetActive(false);
             m_Pool.Enqueue(box);
         }
     }
 }
Exemple #5
0
        private void PaintStackBox(StackBox stackBox)
        {
            float ox = Painter.OriginX;//***
            float oy = Painter.OriginY;

            int count = stackBox.ChildCount;

            Painter.SetOrigin(stackBox.Left + ox, stackBox.Top + oy);
            _fromPaintHorizontal.Push(false);
            for (int i = 0; i < count; ++i)
            {
                Paint(stackBox.GetChild(i));
            }
            _fromPaintHorizontal.Pop();
            Painter.SetOrigin(ox, oy);//restore
        }