/// <summary> /// パーティリストの作成 /// </summary> void CreatePartyList() { PacketStructUnit[][] partys = UserDataAdmin.Instance.m_StructPartyAssign; m_PartySelectGroup.ClearPartyGroups(); var partyModels = new List <PartySelectGroupUnitListItemModel>(); const int AnimationFirstIndex = 0; const int AnimationLastIndex = 4; for (int i = 0; i < partys.Length; ++i) { PacketStructUnit[] party = partys[i]; int index = i; var model = new PartySelectGroupUnitListItemModel((uint)index); PartySelectGroupUnitContext partyGroup = new PartySelectGroupUnitContext(model); partyGroup.Index = index; // 番号の設定 partyGroup.NameText = string.Format(GameTextUtil.GetText("questlast_tub"), index + 1); // パーティ名 Array.Copy(party, partyGroup.PartyData, partyGroup.PartyData.Length); // ユニット情報をコピー for (int pt_cout = 0; pt_cout < partyGroup.PartyData.Length; ++pt_cout) { // リンクユニット情報を設定 if (partyGroup.PartyData[pt_cout] == null) { continue; } partyGroup.PartyLinkData[pt_cout] = CharaLinkUtil.GetLinkUnit(partyGroup.PartyData[pt_cout].link_unique_id); } PacketStructUnit leaderUnit = partyGroup.PartyData[(int)GlobalDefine.PartyCharaIndex.LEADER]; if (leaderUnit != null) { // リーダーユニット画像 UnitIconImageProvider.Instance.Get( leaderUnit.id, sprite => { partyGroup.UnitImage = sprite; }); //partyGroup.IsActiveLinkIcon = (leaderUnit.link_info != (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_NONE); // リンクアイコン MasterDataParamChara _master = MasterFinder <MasterDataParamChara> .Instance.Find((int)leaderUnit.id); partyGroup.IconSelect = MainMenuUtil.GetElementCircleSprite(_master.element); } partyGroup.IsSelect = (index == m_UnitPartyCurrent); m_PartySelectGroup.AddData(partyGroup); model.OnClicked += () => { OnSelectPartyGroup(partyGroup); }; model.OnShowedNextIcon += () => { if (index <= AnimationFirstIndex || index > AnimationLastIndex) { return; } partyModels[index - 1].ShowIcon(); }; model.OnShowedNextName += () => { if (index >= AnimationLastIndex) { return; } partyModels[index + 1].ShowName(); }; model.OnViewStarted += () => { bool showName = index == AnimationFirstIndex || index > AnimationLastIndex; bool showIcon = index == AnimationLastIndex || index > AnimationLastIndex; if (showName) { model.ShowName(); } if (showIcon) { model.ShowIcon(); } }; partyModels.Add(model); } }