Example #1
0
        public CostumeViewer(Costume costume, Anchor anchor, float x, float y) :
            base(anchor, x, y, false)
        {
            var left = new InvisiblePanel(Anchor.CenterLeft, SLOT_VIEWER_WIDTH, 1f);

            for (ItemPurpose i = ItemPurpose.Head; i <= ItemPurpose.Boots; i++)
            {
                left.AddChild(new SlotViewer(costume.Clothes[i], Anchor.AutoCenter, 1f, SLOT_VIEWER_HEIGHT));
                left.AddChild(new VerticalSpace(BERTICAL_SPACE_SIZE));
            }
            AddChild(left);

            var right = new InvisiblePanel(Anchor.CenterRight, SLOT_VIEWER_WIDTH, 1f);

            for (ItemPurpose i = ItemPurpose.Amulet; i <= ItemPurpose.Ring; i++)
            {
                right.AddChild(new SlotViewer(costume.Clothes[i], Anchor.AutoCenter, 1f, SLOT_VIEWER_HEIGHT));
                right.AddChild(new VerticalSpace(BERTICAL_SPACE_SIZE));
            }
            right.AddChild(new SlotViewer(costume.SecondRing, Anchor.AutoCenter, 1f, SLOT_VIEWER_HEIGHT));
            right.AddChild(new VerticalSpace(BERTICAL_SPACE_SIZE));
            right.AddChild(new SlotViewer(costume.Clothes[ItemPurpose.Shield], Anchor.AutoCenter, 1f, SLOT_VIEWER_HEIGHT));
            right.AddChild(new VerticalSpace(BERTICAL_SPACE_SIZE));
            AddChild(right);
            AddChild(new SlotViewer(costume.Clothes[ItemPurpose.Weapon], Anchor.BottomCenter, SLOT_VIEWER_WIDTH, SLOT_VIEWER_HEIGHT));
        }
Example #2
0
 public void Init(int timelineId, float delay = 0)
 {
     _delay     = delay;
     _purpose   = GetComponentInChildren <ItemPurpose>();
     _render    = GetComponent <SpriteRenderer>();
     TimelineId = timelineId;
     EventBus.Subscribe <CommandEvent>(OnCommandEvent);
     EventBus.Subscribe <GameEvent>(OnGameEvent);
 }
Example #3
0
 public Slot(ItemPurpose a)
 {
     Type = a;
 }