public void CreateSkillList(MasterDataHero master) { UnitSkillContext unit = new UnitSkillContext(); unit.setupHeroSkill((uint)master.default_skill_id, 0, 0, true); SkillList.Add(unit); }
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; }
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; }
public void Decision(MasterDataHero master, Action finishDecision = null, Action cancelAction = null) { m_decision = true; TutorialManager.SendStep((int)TutorialStep.HERO_SELECT, () => { Dialog newDialog = Dialog.Create(DialogType.DialogYesNo).SetStrongYes(); newDialog.SetDialogTextFromTextkey(DialogTextType.Title, "tutorial_master_result_02_title"); newDialog.SetDialogText(DialogTextType.MainText, string.Format(GameTextUtil.GetText("tutorial_master_result_02_main"), master.name)); newDialog.SetDialogTextFromTextkey(DialogTextType.YesText, "common_button4"); newDialog.SetDialogTextFromTextkey(DialogTextType.NoText, "common_button5"); newDialog.SetDialogEvent(DialogButtonEventType.YES, new System.Action(() => { ServerDataUtilSend.SendPacketAPI_SelectDefParty((uint)master.default_party_id). setSuccessAction(_data => { // DG0-2733 Tutorial時、StructPlayer.renew_tutorial_step == 100 に更新される UserDataAdmin.Instance.m_StructPlayer = _data.UpdateStructPlayer <RecvSelectDefParty>((PacketStructPlayer)UserDataAdmin.Instance.m_StructPlayer); UserDataAdmin.Instance.m_StructHeroList = _data.GetResult <RecvSelectDefParty>().result.hero_list; UserDataAdmin.Instance.ConvertPartyAssing(); if (finishDecision != null) { finishDecision(); } m_finishDecision = true; //旧チュートリアルでパーティ選択しているか PacketStructPlayer player = UserDataAdmin.Instance.m_StructPlayer; if (player.first_select_num == TutorialManager.FirstSelectNone) { //選択していない [新規ユーザー] TutorialManager.PP.TutorialUserType = TutorialUserType.NEW; } else { //選択している [既存ユーザー] TutorialManager.PP.TutorialUserType = TutorialUserType.ALREADY; } TutorialManager.PP.Save(); TutorialHeroSelectFSM.Instance.SendFsmPositiveEvent(); }). setErrorAction(data => { if (cancelAction != null) { cancelAction(); } SoundUtil.PlaySE(SEID.SE_MENU_NG); //---------------------------------------- // ここでエラーが発生すると // シャーディングの都合上サーバー側のセーブデータが使用不可能になるらしい。 // // 例外対応として、UUIDを破棄して最初からゲームをやり直すようにする。 // ダイアログを出してボタン待ちとかやるとユーザーの操作で抜けが発生するので、 // そのままセーブ破棄してQuitを呼んでアプリを強制的に落とす //---------------------------------------- DialogManager.Open1B("ERROR_MSG_USER_TITLE", "ERROR_MSG_USER", "common_button7", true, true). SetOkEvent(() => { PacketStructPlayer player = UserDataAdmin.Instance.m_StructPlayer; if (player.first_select_num == TutorialManager.FirstSelectNone) { //選択していない [新規ユーザー] LocalSaveManager.Instance.SaveFuncUUID(""); } Application.Quit(); }); }). SendStart(); })); newDialog.SetDialogEvent(DialogButtonEventType.NO, new System.Action(() => { if (cancelAction != null) { cancelAction(); } m_decision = false; TutorialHeroSelectFSM.Instance.SendFsmNegativeEvent(); })); newDialog.EnableFadePanel(); newDialog.DisableCancelButton(); newDialog.Show(); TutorialHeroSelectFSM.Instance.SendFsmPositiveEvent(); }); }
// Update is called once per frame void Update() { if (m_UpdateMode == UpdateMode.NONE) { return; } m_AnimSpeed = (m_IsSpeedUp) ? 1.75f : 1.0f; LocalSaveOption cOption = LocalSaveManager.Instance.LoadFuncOption(); if (cOption != null) { m_AnimSpeed *= (cOption.m_OptionSpeed != 0) ? 1.0f : 0.6f; } float delta_time = Time.deltaTime; for (int idx = 0; idx < m_CutinObjects.Length; idx++) { m_CutinObjects[idx].update(delta_time); } if (m_DisappearCutinObjectInfo != null) { if (m_DisappearCutinObjectInfo.getPhase() != CutinObjectInfo.Phase.DISSPPEAR) { m_DisappearCutinObjectInfo = null; } } if (m_CurrentCutinObjectInfo != null && m_CurrentCutinObjectInfo.getPhase() == CutinObjectInfo.Phase.APPEAR) { // スキル表示物を下地のスケールに合わせる(キャラ出現時用) m_SkillAreaTransform.localScale = m_CurrentCutinObjectInfo.m_BGTransform.localScale; return; } m_SkillAreaTransform.localScale = Vector3.one; updateSkillAnim(delta_time); if (m_UpdateMode != UpdateMode.STEP_WAIT && m_SkillTime <= 0.0f) { // 割り込みスキル if (m_ResurrectInfo != null) { m_SkillInfos.Insert(0, m_ResurrectInfo); m_ResurrectInfo = null; } // アニメーションしていないので次のスキルへ if (m_IsNoCutinMode == false) { if (m_SkillInfos.Count > 0) { int old_key = -1; if (m_CurrentSkillInfo != null) { old_key = m_CurrentSkillInfo.m_Key; } m_CurrentSkillInfo = m_SkillInfos[0]; m_SkillInfos.RemoveAt(0); if (old_key != m_CurrentSkillInfo.m_Key) { int caster_chara_id = 0; MasterDataDefineLabel.ElementType skill_element = m_CurrentSkillInfo.m_SkillElement; if (m_CurrentSkillInfo.m_Caster == GlobalDefine.PartyCharaIndex.HERO) { caster_chara_id = 0; if (UserDataAdmin.HasInstance) { ServerDataDefine.PacketStructHero current_hero = UserDataAdmin.Instance.getCurrentHero(); if (current_hero != null) { MasterDataHero master_data_hero = MasterFinder <MasterDataHero> .Instance.Find(current_hero.hero_id); if (master_data_hero != null) { caster_chara_id = -current_hero.hero_id; if (skill_element == MasterDataDefineLabel.ElementType.NONE) { skill_element = master_data_hero.getElement(); } } } } } else { CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember(m_CurrentSkillInfo.m_Caster, CharaParty.CharaCondition.EXIST); if (chara_once != null) { MasterDataParamChara chara_master = chara_once.m_CharaMasterDataParam; if ((m_CurrentSkillInfo.m_SkillType == ESKILLTYPE.eLINK || m_CurrentSkillInfo.m_SkillType == ESKILLTYPE.eLINKPASSIVE) && chara_once.m_LinkParam != null ) { MasterDataParamChara link_chara_master = chara_once.m_LinkParam.m_cCharaMasterDataParam; if (link_chara_master != null) { chara_master = link_chara_master; } } caster_chara_id = (int)chara_master.fix_id; if (skill_element == MasterDataDefineLabel.ElementType.NONE) { skill_element = chara_master.element; } } } if (m_CurrentCutinObjectInfo != null) { m_DisappearCutinObjectInfo = m_CurrentCutinObjectInfo; m_CurrentCutinObjectInfo = null; m_DisappearCutinObjectInfo.animDisappear(); } if (m_DisappearCutinObjectInfo != m_CutinObjects[0]) { m_CurrentCutinObjectInfo = m_CutinObjects[0]; m_CutinObjects[1].m_RootObject.transform.SetSiblingIndex(0); m_CutinObjects[0].m_RootObject.transform.SetSiblingIndex(1); } else { m_CurrentCutinObjectInfo = m_CutinObjects[1]; m_CutinObjects[0].m_RootObject.transform.SetSiblingIndex(0); m_CutinObjects[1].m_RootObject.transform.SetSiblingIndex(1); } m_CurrentCutinObjectInfo.initAnim(caster_chara_id, m_BgImages[(int)skill_element], m_IsEnableCharaImage); m_CurrentCutinObjectInfo.animAppear(); // キャラ出現時用のスキル表示物を設定 //if (m_CurrentSkillInfo != null) { m_SkillObjects[0].SetActive(false); setupSkillPanel(m_SkillObjects[1], m_CurrentSkillInfo, m_SkillLocateNext1.transform); m_SkillObjects[1].SetActive(true); if (m_SkillInfos.Count >= 1 && m_CurrentSkillInfo.m_Key == m_SkillInfos[0].m_Key) { setupSkillPanel(m_SkillObjects[2], m_SkillInfos[0], m_SkillLocateNext2.transform); m_SkillObjects[2].SetActive(true); } else { m_SkillObjects[2].SetActive(false); } } m_SkillAreaTransform.localScale = new Vector3(1.0f, 0.0f, 1.0f); } else { if (m_CurrentCutinObjectInfo != null && m_CurrentSkillInfo != null && m_CurrentSkillInfo.m_SkillElement != MasterDataDefineLabel.ElementType.NONE ) { Sprite bg_elem_sprite = m_BgImages[(int)m_CurrentSkillInfo.m_SkillElement]; m_CurrentCutinObjectInfo.startChangeElementAnimation(bg_elem_sprite, CutinObjectInfo.ANIM_TIME_SKILL * 0.25f / m_AnimSpeed); } } startSkillAnim(); } else { if (m_ResurrectInfo == null) { m_CurrentSkillInfo = null; if (m_CurrentCutinObjectInfo != null) { // キャラの消滅アニメ開始 m_DisappearCutinObjectInfo = m_CurrentCutinObjectInfo; m_CurrentCutinObjectInfo = null; m_DisappearCutinObjectInfo.animDisappear(); m_UpdateMode = UpdateMode.AUTO; } else { // すべて終了 if (m_DisappearCutinObjectInfo == null) { m_UpdateMode = UpdateMode.NONE; } } } } } else { if (m_SkillInfos.Count > 0) { m_CurrentSkillInfo = m_SkillInfos[0]; m_SkillInfos.RemoveAt(0); startSkillAnim(); } else { m_CurrentSkillInfo = null; m_UpdateMode = UpdateMode.NONE; } } } }
void LoadHeroData() { m_HeroSelectList = new List <HeroSelectListContext>(); MasterDataHero[] masters = MasterFinder <MasterDataHero> .Instance.SelectWhere("ORDER BY fix_id").ToArray(); m_TutorialHeroSelect.m_HeroImage = new Sprite[masters.Length]; m_TutorialHeroSelect.m_HeroImage_mask = new Texture[masters.Length]; // アセットバンドルの読み込み AssetBundlerMultiplier multiplier = AssetBundlerMultiplier.Create(); for (int i = 0; i < masters.Length; i++) { MasterDataHero heromaster = masters[i]; string hero_name = String.Format("hero_{0:D4}", heromaster.fix_id); string hero_perfom_name = String.Format("tex_hero_perform_l_{0:D4}", heromaster.fix_id); string hero_mask_name = String.Format("tex_hero_perform_l_{0:D4}_mask", heromaster.fix_id); int index = i; multiplier.Add(AssetBundler.Create().Set(hero_name, hero_perfom_name, (o) => { Sprite[] sprites = o.AssetBundle.LoadAssetWithSubAssets <Sprite>(hero_name); Sprite[] herosprites = o.AssetBundle.LoadAssetWithSubAssets <Sprite>(hero_perfom_name); Texture maskTextue = o.GetTexture(hero_mask_name, TextureWrapMode.Clamp); m_TutorialHeroSelect.m_HeroImage[index] = herosprites[0]; m_TutorialHeroSelect.m_HeroImage_mask[index] = maskTextue; switch (index) { case 0: m_TutorialHeroSelect.Tutorial_hero01 = sprites[4]; break; case 1: m_TutorialHeroSelect.Tutorial_hero02 = sprites[4]; break; case 2: m_TutorialHeroSelect.Tutorial_hero03 = sprites[4]; break; case 3: m_TutorialHeroSelect.Tutorial_hero04 = sprites[4]; break; case 4: m_TutorialHeroSelect.Tutorial_hero05 = sprites[4]; break; case 5: m_TutorialHeroSelect.Tutorial_hero06 = sprites[4]; break; } HeroSelectListContext heroSelect = new HeroSelectListContext(); heroSelect.CreatePartyParam(heromaster.default_party_id, this); heroSelect.CreateSkillList(heromaster); heroSelect.Tutorial_text = GameTextUtil.GetText("tutorial_selecttext13"); heroSelect.Profile_text = heromaster.detail; m_HeroSelectList.Add(heroSelect); })); } multiplier.Load(() => { StartCoroutine(LoadHeroDataWait()); }, () => { StartCoroutine(LoadHeroDataWait()); }); }