コード例 #1
0
        public void Initialize(
            InventoryWatcher inventoryWatcher,
            FormationWatcher formationWatcher,
            int index,
            ChoiceSlotEvent onChoiceSlot
            )
        {
            _formationWatcher = formationWatcher;

            _partyInformation = Instantiate(partyListRowPrefab, transform);
            _partyInformation.Initialize(
                inventoryWatcher,
                _formationWatcher,
                index,
                true,
                new ChoicePartyEvent(),
                onChoiceSlot
                );
            _partyInformation.gameObject.SetActive(true);
            gameObject.SetActive(true);
        }
コード例 #2
0
        public void Initialize(
            InventoryWatcher inventoryWatcher,
            FormationWatcher formationWatcher,
            int index,
            bool enableSelectUnit,
            ChoicePartyEvent onChoiceParty,
            ChoiceSlotEvent onChoiceSlot
            )
        {
            _inventoryWatcher = inventoryWatcher;
            _formationWatcher = formationWatcher;
            _index            = index;
            _enableSelectUnit = enableSelectUnit;
            _onChoiceParty    = onChoiceParty;
            _onChoiceSlot     = onChoiceSlot;
            _formationWatcher.onWatchFormation.AddListener(OnChangeFormation);

            OnChangeFormation(
                _formationWatcher.MoldModel,
                _index,
                _formationWatcher.Forms.FirstOrDefault(form => form.Index == index)
                );
        }
コード例 #3
0
        public void OnChoiceParty(
            EzMoldModel moldModel,
            int index,
            EzForm form
            )
        {
            Debug.Log("PartyDirector::OnChoiceParty");

            _selectedMoldModel = moldModel;
            _selectedMoldIndex = index;
            if (form == null)
            {
                var slots = new List <EzSlot>();
                foreach (var slot in _selectedMoldModel.FormModel.Slots)
                {
                    slots.Add(
                        new EzSlot
                    {
                        Name = slot.Name,
                    }
                        );
                }
                _selectedForm = new EzForm
                {
                    Index = index,
                    Slots = slots,
                };
            }
            else
            {
                _selectedForm = form;
            }

            void OnChoiceSlot(
                EzForm _,
                int slotIndex,
                EzSlot __
                )
            {
                Debug.Log("PartyDirector::OnChoiceSlot");

                _selectedSlotIndex = slotIndex;
            }

            var onChoiceSlot = new ChoiceSlotEvent();

            onChoiceSlot.AddListener(OnChoiceSlot);
            partyInformationWidget.Initialize(
                _unitInventoryWatcher,
                _formationWatcher,
                index,
                onChoiceSlot
                );

            partyUnitListWidget.Initialize(
                _unitInventoryWatcher,
                _formationWatcher,
                _selectedMoldIndex,
                _selectedForm
                );

            partyListWidget.gameObject.SetActive(false);
            partyUnitListWidget.gameObject.SetActive(true);
        }