コード例 #1
0
 public void ApplyModel(iComponentModel data)
 {
     model = data as ScreenPlayerInventoryModel;
     localScrollList.ApplyModel(model.localInventoryScroll);
     placeButton.SetStyle(placeButtonStyle);
     placeButton.Create(new IconButtonModel(ScreenPlayerInventorySignals.placeButtonClicked));
 }
コード例 #2
0
        public void ApplyModel(iComponentModel data)
        {
            currentNPC = playerManager.NPCLookingAt();

            model = data as ScreenNPCInteractionModel;

            nameText.SetText(model.name);

            IconStateButtonModel[] startModelList = new IconStateButtonModel[] {
                new IconStateButtonModel(ScreenNPCInteractionSignals.removeRouteStart, startButtonStyles[0]),
                new IconStateButtonModel(ScreenNPCInteractionSignals.setRouteStart, startButtonStyles[1])
            };
            startButton.Create(startModelList);
            startButton.ForceState(Convert.ToInt32(model.routeDestination != null));

            IconStateButtonModel[] destinationModelList = new IconStateButtonModel[] {
                new IconStateButtonModel(ScreenNPCInteractionSignals.removeRouteDestination, destinationButtonStyles[1]),
                new IconStateButtonModel(ScreenNPCInteractionSignals.setRouteDestination, destinationButtonStyles[0])
            };
            destinationButton.Create(destinationModelList);
            destinationButton.ForceState(Convert.ToInt32(model.routeDestination != null));

            IconStateButtonModel[] toggleModelList = new IconStateButtonModel[] {
                new IconStateButtonModel(ScreenNPCInteractionSignals.pauseRoutes, toggleStateButtonStyles[1]),
                new IconStateButtonModel(ScreenNPCInteractionSignals.runRoutes, toggleStateButtonStyles[0])
            };
            toggleStateButton.Create(toggleModelList);
            toggleStateButton.ForceState(Convert.ToInt32(currentNPC.routeManager.running));
        }
コード例 #3
0
        public void ApplyModel(iComponentModel data)
        {
            model = data as ScreenMarketModel;

            localScrollList.ApplyModel(model.localInventoryScroll);
            shopScrollList.ApplyModel(model.shopInventoryScroll);

            UpdateModel();
        }
コード例 #4
0
        public void ApplyModel(iComponentModel data)
        {
            model = (ItemContainerModel)data;
            textField.SetText(model.item.name.ToString());//todo: replace with amount when introduced

            textField.SetTextStyle(textStyle);
            image.sprite = model.item.img;
            selectedOverlay.SetActive(model.selected);
        }
コード例 #5
0
        public void ApplyModel(iComponentModel data)
        {
            Reset();

            model = (ScrollListModel)data;
            if (model != null && model.gridItems != null)
            {
                for (int i = 0; i < model.gridItems.Count; i++)
                {
                    var item = Container.Resolve <ItemContainer>();
                    item.ApplyModel(model.gridItems[i]);
                    item.transform.SetParent(gridContentHolder, false);
                    gridItems.Add(item);
                }
            }
            GenerateGrid();
        }
コード例 #6
0
        public void ApplyModel(iComponentModel data)
        {
            model = data as ScreenInventoryTransferModel;

            localScrollList.ApplyModel(model.localInventoryScroll);

            if (model.remoteInventoryType == ObjectInventoryTypes.Type.Scroll)
            {
                remoteSubmodule = remoteScrollList;
            }
            else if (model.remoteInventoryType == ObjectInventoryTypes.Type.Two)
            {
                remoteSubmodule = screenMachineProcessor;
            }

            remoteSubmodule.ApplyModel(model.remoteInventory as iComponentModel);
            var monoSubmodule = remoteSubmodule as MonoBehaviour;

            monoSubmodule.gameObject.SetActive(true);
        }
コード例 #7
0
        public void ApplyModel(iComponentModel data)
        {
            Reset();
            model = (ScreenMachineProcessorModel)data;

            if (model != null)
            {
                if (model.inputItem != null)
                {
                    var itemContainerInput = Container.Resolve <ItemContainer>();
                    itemContainerInput.ApplyModel(model.inputItem);
                    inputItem = itemContainerInput.transform;
                    inputItem.SetParent(inputContainer, false);
                }

                if (model.outputItem != null)
                {
                    var itemContainerOutput = Container.Resolve <ItemContainer>();
                    itemContainerOutput.ApplyModel(model.outputItem);
                    outputItem = itemContainerOutput.transform;
                    outputItem.SetParent(outputContainer, false);
                }
            }
        }
コード例 #8
0
 public void ApplyModel(iComponentModel data)
 {
     model = data as ScreenPlayerInventoryModel;
     textField.SetText(model.cashAmount.ToString());
     textField.SetTextStyle(headerCashTxtStyle);
 }
コード例 #9
0
 public void ApplyModel(iComponentModel data)
 {
     model = data as ScreenSubmenuTabsModel;
 }