Example #1
0
        public void Init(Canvas parent, ItemFragment.Factory itemFragment, List <ItemModel> items)
        {
            _itemFragment = itemFragment;

            CloseButton.onClick.AddListener(Hide);
            Refresh(items);
            ShowAt(parent);
        }
Example #2
0
        public void Init(
            GameStateUpdateService update, ItemService items, UnitService units,
            ItemFragment.Factory itemFragment, ItemsWindow.Factory itemsWindow,
            Canvas parent, StateUnitModel unit
            )
        {
            _update       = update;
            _items        = items;
            _units        = units;
            _itemFragment = itemFragment;
            _itemsWindow  = itemsWindow;
            _unit         = unit;

            update.AddHandler <EquipItemCommand>  (OnEquipItem);
            update.AddHandler <TakeOffItemCommand>(OnTakeOffItem);

            CloseButton.onClick.AddListener(Hide);

            CreateFragments();
            Refresh();

            ShowAt(parent);
        }