コード例 #1
0
    public void CreateSkillList(MasterDataHero master)
    {
        UnitSkillContext unit = new UnitSkillContext();

        unit.setupHeroSkill((uint)master.default_skill_id, 0, 0, true);
        SkillList.Add(unit);
    }
コード例 #2
0
    public void SetDetail(PacketStructHero heroData)
    {
        ClearView();
        if (heroData == null || heroData.hero_id == 0)
        {
            return;
        }
        MasterDataHero heroMaster = MasterFinder <MasterDataHero> .Instance.Find((int)heroData.hero_id);

        if (heroMaster == null)
        {
            return;
        }

        SetUpHeroName(heroData.hero_id); // 名前
        MessageText = heroMaster.detail; // 詳細テキスト

        AssetBundler.Create().Set("hero_" + heroData.hero_id.ToString("0000"), "hero_" + heroData.hero_id.ToString("0000"), (o) =>
        {
            Sprite[] sprite = o.AssetBundle.LoadAssetWithSubAssets <Sprite>("hero_" + heroData.hero_id.ToString("0000"));
            HeroImage       = sprite[4];
        }).Load();
        //------------------------------------------------------------------
        // グレードの設定
        //------------------------------------------------------------------
        m_GradeNum = heroData.level;

        MasterDataHeroLevel nextHeroLevelMaster = MasterFinder <MasterDataHeroLevel> .Instance.Find((int)heroData.level + 1);

        if (nextHeroLevelMaster != null)
        {
            m_NextGradeNum = nextHeroLevelMaster.exp_next_total - heroData.exp;
        }
        else
        {
            m_NextGradeNum = 0;
        }

        //------------------------------------------------------------------
        // イラストレーター名
        //------------------------------------------------------------------

        /*
         *      MasterDataIllustrator illustratorMaster = MasterFinder<MasterDataIllustrator>.Instance.Find((int)heroMaster.illustrator_id);
         *      if (illustratorMaster != null)
         *      {
         *          IllustratorText = illustratorMaster.name;
         *      }
         */
        //------------------------------------------------------------------
        // スキルの設定
        //------------------------------------------------------------------
        List <UnitSkillContext> skillList = new List <UnitSkillContext>();
        UnitSkillContext        skill     = new UnitSkillContext();

        skill.setupHeroSkill((uint)heroMaster.default_skill_id, 0, 0, true);
        skillList.Add(skill);
        Skills = skillList;
    }
コード例 #3
0
ファイル: HeroDetail.cs プロジェクト: mliuzailin/GitGame
    public void SetDetail(PacketStructHero heroData, Action <HeroStoryListItemContext> _OnClickStoryItem)
    {
        ClearView();
        if (heroData == null || heroData.hero_id == 0)
        {
            return;
        }
        MasterDataHero heroMaster = MasterFinder <MasterDataHero> .Instance.Find((int)heroData.hero_id);

        if (heroMaster == null)
        {
            return;
        }

        SetUpHeroName(heroData.hero_id); // 名前
        MessageText = heroMaster.detail; // 詳細テキスト

        AssetBundler.Create().Set("hero_" + heroData.hero_id.ToString("0000"), "hero_" + heroData.hero_id.ToString("0000"), (o) =>
        {
            Sprite[] sprite = o.AssetBundle.LoadAssetWithSubAssets <Sprite>("hero_" + heroData.hero_id.ToString("0000"));
            HeroImage       = sprite[4];
        }).Load();
        //------------------------------------------------------------------
        // グレードの設定
        //------------------------------------------------------------------
        m_GradeNum = heroData.level;

        MasterDataHeroLevel nextHeroLevelMaster = MasterFinder <MasterDataHeroLevel> .Instance.Find((int)heroData.level + 1);

        if (nextHeroLevelMaster != null)
        {
            m_NextGradeNum = nextHeroLevelMaster.exp_next_total - heroData.exp;
        }
        else
        {
            m_NextGradeNum = 0;
        }

        //------------------------------------------------------------------
        // イラストレーター名
        //------------------------------------------------------------------
        MasterDataIllustrator illustratorMaster = MasterFinder <MasterDataIllustrator> .Instance.Find((int)heroMaster.illustrator_id);

        if (illustratorMaster != null)
        {
            IllustratorText = illustratorMaster.name;
        }

        //------------------------------------------------------------------
        // スキルの設定
        //------------------------------------------------------------------
        List <UnitSkillContext> skillList = new List <UnitSkillContext>();
        UnitSkillContext        skill     = new UnitSkillContext();

        skill.setupHeroSkill((uint)heroMaster.default_skill_id, heroData.hero_id, m_GradeNum, true);
        skillList.Add(skill);
        Skills = skillList;

        //------------------------------------------------------------------
        // ストーリの設定
        //------------------------------------------------------------------
        List <HeroStoryListItemContext> storyList = new List <HeroStoryListItemContext>();

        for (int i = 0; i < 4; ++i)
        {
            var model = new ListItemModel((uint)i);
            HeroStoryListItemContext story = new HeroStoryListItemContext(model);
            story.StoryTitle = "";
            storyList.Add(story);

            model.OnClicked += () =>
            {
                _OnClickStoryItem(story);
            };

            // TODO : 演出を入れるならそこに移動
            model.Appear();
            model.SkipAppearing();
        }

        SetStory(storyList[0], (uint)heroData.hero_id);
        storyList[1].ContentText = "";
        storyList[2].ContentText = "";
        storyList[3].ContentText = "";

        storyList[0].IsOpenStory = true;

        Stories = storyList;
    }
コード例 #4
0
    //----------------------------------------------------------------------------

    /*!
     *          @brief	スキル発動ウィンドウOPEN
     *          @param[in]	GlobalDefine.PartyCharaIndex	(charaIdx)		キャラパーティインデックス
     *          @param[in]	uint							(charaId)		キャラID
     */
    //----------------------------------------------------------------------------
    public void OpenSkillMenu(GlobalDefine.PartyCharaIndex charaIdx, uint charaId, int turn, bool bSealed = false)
    {
        if (m_InGameMenuQuest2 == null)
        {
            return;
        }
        if (charaIdx == GlobalDefine.PartyCharaIndex.ERROR)
        {
            return;
        }
        // 既に開いてる場合
        if (m_SkillMenuActive == true)
        {
            // 一旦初期化する
            if (InGameUtil.isQuest2() == true)
            {
                changePartyUnitParent(false);
            }
            if (m_CharaIdx == GlobalDefine.PartyCharaIndex.HERO)
            {
                m_newSkill.setupHeroSkill(0);
            }
            else
            {
                m_newSkill.setupLimitBreakSkill(0, 0);
            }
            m_InGameMenuQuest2.Skill_menu_active = false;
            m_InGameMenuQuest2.Menu_bg_active    = false;
        }

        m_SkillMenuActive = true;
        m_CharaIdx        = charaIdx;
        uint skill_limitbreak = 0;
        uint limitbreak_lv    = 0;

        if (charaIdx == GlobalDefine.PartyCharaIndex.HERO)
        {
            int unique_id = UserDataAdmin.Instance.m_StructPlayer.current_hero_id;
            for (int i = 0; i < UserDataAdmin.Instance.m_StructHeroList.Length; ++i)
            {
                if (UserDataAdmin.Instance.m_StructHeroList[i].unique_id == unique_id)
                {
                    skill_limitbreak = (uint)UserDataAdmin.Instance.m_StructHeroList[i].current_skill_id;
                }
            }
        }
        else
        {
            MasterDataParamChara _master = InGamePlayerParty.m_PlayerPartyChara[(int)m_CharaIdx].m_CharaMasterDataParam;
            skill_limitbreak = _master.skill_limitbreak;
            limitbreak_lv    = (uint)InGamePlayerParty.m_PlayerPartyChara[(int)m_CharaIdx].m_CharaLBSLv;
        }

        if (m_newSkill == null)
        {
            m_newSkill = new UnitSkillContext();
            m_InGameMenuQuest2.SkillList.Add(m_newSkill);
        }
        if (charaIdx == GlobalDefine.PartyCharaIndex.HERO)
        {
            m_newSkill.setupHeroSkill(skill_limitbreak);
        }
        else
        {
            m_newSkill.setupLimitBreakSkill(skill_limitbreak, limitbreak_lv);
        }

        m_InGameMenuQuest2.Skill_menu_active = true;
        m_InGameMenuQuest2.Menu_bg_active    = true;

        changePartyUnitParent(true);

        SoundUtil.PlaySE(SEID.SE_BATLE_UI_OPEN);
        m_MenuButton.color = m_MenuButtonGray;
        m_OkDisable        = false;
        m_InGameMenuQuest2.SkillMenuOkColor = Color.white;
        if (turn == 0)
        {
            if (bSealed == true)
            {
                m_InGameMenuQuest2.Skill_title_text = GameTextUtil.GetText("unit_action_01");
                m_InGameMenuQuest2.IsBack           = true;
            }
            else
            {
                m_InGameMenuQuest2.Skill_title_text = GameTextUtil.GetText("battle_infotext6");
                m_InGameMenuQuest2.IsBack           = false;
                if (charaIdx != GlobalDefine.PartyCharaIndex.HERO)
                {
                    if (BattleSceneUtil.checkLimitBreak(BattleParam.m_PlayerParty, m_CharaIdx, BattleParam.m_EnemyParam, BattleParam.m_TargetEnemyCurrent) == false)
                    {
                        m_OkDisable = true;
                        m_InGameMenuQuest2.SkillMenuOkColor = Color.gray;
                    }
                }
            }
        }
        else
        {
            if (charaIdx == GlobalDefine.PartyCharaIndex.HERO)
            {
                m_InGameMenuQuest2.Skill_title_text = string.Format(GameTextUtil.GetText("hero_skill_hands_battle"), turn);
            }
            else
            {
                m_InGameMenuQuest2.Skill_title_text = string.Format(GameTextUtil.GetText("unit_skill_turn_battle"), turn);
            }
            m_InGameMenuQuest2.IsBack = true;
        }
        UnityUtil.SetObjectEnabled(m_MenuButtonMask, true);
    }