示例#1
0
 public void UnloadUI()
 {
     WandSlot = null;
     foreach (SpellComponentInvSlotUI slot in SpellElementSlots)
     {
         slot.UnloadUI();
     }
     SpellElementSlots = null;
 }
示例#2
0
        public override void OnInitialize()
        {
            DragableUIPanel panel = new DragableUIPanel();

            panel.Width.Set(UIWIDTH, 0);
            panel.Height.Set(UIHEIGHT, 0);
            panel.HAlign = 0.5f;


            WandSlot        = new WandInvSlotUI();
            WandSlot.HAlign = 0.5f;
            WandSlot.VAlign = 0f;
            panel.Append(WandSlot);

            int y         = 1;
            int x         = 0;
            int xcountmax = (int)(UIWIDTH / InvSlotUI.panelwidth);

            for (int i = 0; i < 20; i++)
            {
                SpellComponentInvSlotUI slot = new SpellComponentInvSlotUI();
                SpellElementSlots.Add(slot);
                if (x >= xcountmax)
                {
                    x = 0;
                    y++;
                }

                slot.MarginLeft = x * InvSlotUI.panelwidth;
                slot.MarginTop  = y * InvSlotUI.panelheight + 5f;
                panel.Append(slot);
                x++;
            }


            Append(panel);
            WaitingForInsert = true;
        }