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); }
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) ); }
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); }