Esempio n. 1
0
 public void ApplyModel(iComponentModel data)
 {
     model = data as ScreenPlayerInventoryModel;
     localScrollList.ApplyModel(model.localInventoryScroll);
     placeButton.SetStyle(placeButtonStyle);
     placeButton.Create(new IconButtonModel(ScreenPlayerInventorySignals.placeButtonClicked));
 }
Esempio n. 2
0
        void Start()
        {
            textField.transform.SetParent(textHolder, false);
            marketInfo.transform.SetParent(marketInfoHolder, false);
            localScrollList.transform.SetParent(localScrollListHolder, false);
            shopScrollList.transform.SetParent(remoteScrollListHolder, false);

            buyButton.transform.SetParent(buyButtonHolder, false);
            buyButton.Create(new IconButtonModel(ScreenMarketSignals.Buy_Button_Pressed));
            buyButton.SetStyle(buyButtonStyle);
            buyButton.button.interactable = false;
            this.Subscribe(ScreenMarketSignals.Buy_Button_Pressed, () => { this.manager.BuyItems(model.shopInventoryScroll, model.localInventoryScroll); });
        }
        void BuildTransferButtons()
        {
            localTransferButton.transform.SetParent(localTransferButtonHolder, false);
            localTransferButtonHolder.GetComponent <IconButtonStyleSetter>().SetStyle();
            localTransferButton.Create(new IconButtonModel(ScreenInventoryTransferSignals.localTransferButtonPressed));
            localTransferButton.button.interactable = false;

            remoteTransferButton.transform.SetParent(remoteTransferButtonHolder, false);
            remoteTransferButtonHolder.GetComponent <IconButtonStyleSetter>().SetStyle();
            remoteTransferButton.Create(new IconButtonModel(ScreenInventoryTransferSignals.remoteTransferButtonPressed));
            remoteTransferButton.button.interactable = false;

            this.Subscribe(ScreenInventoryTransferSignals.localTransferButtonPressed, () => { manager.TransferItems(model.localInventoryScroll, model.remoteInventory, false); });
            this.Subscribe(ScreenInventoryTransferSignals.remoteTransferButtonPressed, () => { manager.TransferItems(model.remoteInventory, model.localInventoryScroll, true); });
        }