Пример #1
0
    /// <summary>
    /// パーティのユニットを長押ししたとき
    /// </summary>
    /// <param name="_unit"></param>
    void OnLongPressParamUnit(PartyMemberUnitContext _unit, MainMenuTutorialHeroSelect heroSelect)
    {
        if (heroSelect.isSelect)
        {
            return;
        }

        if (heroSelect.isDecision)
        {
            return;
        }

        if (heroSelect.isfinishDecision)
        {
            return;
        }

        if (_unit.UnitData != null &&
            _unit.UnitData.id > 0 &&
            MainMenuManager.HasInstance)
        {
            SoundUtil.PlaySE(SEID.SE_MENU_OK2);
            MainMenuManager.Instance.OpenUnitDetailInfoPlayerTutorial(_unit.UnitData, false);
        }
    }
Пример #2
0
    public void CreatePartyParam(int party_id, MainMenuTutorialHeroSelect heroSelect)
    {
        MasterDataDefaultParty masterParty = MasterFinder <MasterDataDefaultParty> .Instance.Find(party_id);

        //-------------------------
        // ユニット設定
        //-------------------------
        List <PartyMemberUnitContext> unitList = new List <PartyMemberUnitContext>();
        int unitDataIndex = 0;

        for (int n = 0; n < 4; ++n)
        {
            uint unit_id    = 0;
            uint unit_level = 0;
            switch (n)
            {
            case 0:
                unit_id    = masterParty.party_chara0_id;
                unit_level = masterParty.party_chara0_level;
                break;

            case 1:
                unit_id    = masterParty.party_chara1_id;
                unit_level = masterParty.party_chara1_level;
                break;

            case 2:
                unit_id    = masterParty.party_chara2_id;
                unit_level = masterParty.party_chara2_level;
                break;

            case 3:
                unit_id    = masterParty.party_chara3_id;
                unit_level = masterParty.party_chara3_level;
                break;

            default:
                break;
            }

            var unitDataModel           = new PartyMemberUnitListItemModel((uint)unitDataIndex++);
            PartyMemberUnitContext unit = new PartyMemberUnitContext(unitDataModel);

            unit.IsActiveStatus = true;
            if (unit_id != 0)
            {
                PacketStructUnit unitData = new PacketStructUnit();
                unitData.id    = unit_id;
                unitData.level = unit_level;

                if (unitData != null)
                {
                    UnitIconImageProvider.Instance.Get(
                        unitData.id,
                        sprite =>
                    {
                        unit.UnitImage = sprite;
                    });
                }
                else
                {
                    unit.OutSideCircleImage = ResourceManager.Instance.Load("icon_circle_deco", ResourceType.Common);
                    unit.UnitImage          = ResourceManager.Instance.Load("icon_empty", ResourceType.Menu);
                }

                unit.UnitData = unitData;
                SetUnitData(ref unit, unitData);

                unitDataModel.OnLongPressed += () =>
                {
                    OnLongPressParamUnit(unit, heroSelect);
                };
            }
            else
            {
                unit.UnitImage = ResourceManager.Instance.Load("icon_empty", ResourceType.Menu);
            }

            unitDataModel.OnShowedNext += () =>
            {
                unitDataModel.ShowStatus();
            };

            unitList.Add(unit);
        }

        unitList[0].PartyCharaIndex = GlobalDefine.PartyCharaIndex.LEADER;
        unitList[1].PartyCharaIndex = GlobalDefine.PartyCharaIndex.MOB_1;
        unitList[2].PartyCharaIndex = GlobalDefine.PartyCharaIndex.MOB_2;
        unitList[3].PartyCharaIndex = GlobalDefine.PartyCharaIndex.MOB_3;

        Units = unitList;
    }