private bool CheckEvolveUnit(long _unique_id) { PacketStructUnit _unit = UserDataAdmin.Instance.SearchChara(_unique_id); //リンクしている・されている if (_unit.link_info != (uint)CHARALINK_TYPE.CHARALINK_TYPE_NONE) { return(false); } //進化先があるか? MasterDataParamCharaEvol _masterEvol = MasterDataUtil.GetCharaEvolParamFromCharaID(_unit.id); if (_masterEvol == null) { return(false); } return(true); }
/// <summary> /// ベース選択で進化条件がそろっているユニットかどうか /// </summary> /// <param name="_unit"></param> /// <returns></returns> private bool CheckBaseUnitEvolve(PacketStructUnit _unit) { MasterDataParamChara _master = MasterFinder <MasterDataParamChara> .Instance.Find((int)_unit.id); if (_master == null) { return(false); } // レベルチェック if (_unit.level != _master.level_max) { return(false); } MasterDataParamCharaEvol _masterEvolve = MasterDataUtil.GetCharaEvolParamFromCharaID(_unit.id); if (_masterEvolve == null) { return(false); } uint blendMoney = _masterEvolve.money; if (MainMenuParam.m_BeginnerBoost != null && MainMenuParam.m_BeginnerBoost.boost_build_money != 100 ) { blendMoney = MasterDataUtil.ConvertBeginnerBoostBuildMoney(ref MainMenuParam.m_BeginnerBoost, blendMoney); } // 所持金チェック if (blendMoney > UserDataAdmin.Instance.m_StructPlayer.have_money) { return(false); } PacketStructUnit tempUnit = m_BaseUnit; List <MaterialDataContext> tempList = m_UnitMaterialPanel.MaterialList; m_UnitMaterialPanel.MaterialList.Clear(); bool ret = true; m_BaseUnit = _unit; long unique_id; // 素材チェック if (_masterEvolve.unit_id_parts1 != 0) { unique_id = SearchMaterialUnit(_masterEvolve.unit_id_parts1, 0); if (unique_id == 0) { ret = false; } m_UnitMaterialPanel.addItem(0, _masterEvolve.unit_id_parts1); m_UnitMaterialPanel.MaterialList[0].setUnit(unique_id); } if (_masterEvolve.unit_id_parts2 != 0) { unique_id = SearchMaterialUnit(_masterEvolve.unit_id_parts2, 0); if (unique_id == 0) { ret = false; } m_UnitMaterialPanel.addItem(1, _masterEvolve.unit_id_parts2); m_UnitMaterialPanel.MaterialList[1].setUnit(unique_id); } if (_masterEvolve.unit_id_parts3 != 0) { if (SearchMaterialUnit(_masterEvolve.unit_id_parts3, 2) == 0) { ret = false; } } m_BaseUnit = tempUnit; m_UnitMaterialPanel.MaterialList.Clear(); m_UnitMaterialPanel.MaterialList = tempList; return(ret); }
/// <summary> /// 進化画面更新 /// </summary> public void updateEvolveStatus(bool bRenew = false, bool bMaterialReset = false) { if (bRenew) { //ユニットリスト作成 makeUnitList(); //ウインドウ閉じる m_ExpandWindow.Close(true); m_UnitGrid.changeGridWindowSize(false, (m_ExpandWindow != null) ? m_ExpandWindow.ViewHeightSize : 0); //パネルを消す m_UnitBGPanel.IsViewPanel = false; //ソートボタン有効化 m_UnitGrid.IsActiveSortButton = true; //確認OFF m_Validate = false; } m_BaseUnit = UserDataAdmin.Instance.SearchChara(MainMenuParam.m_EvolveBaseUnitUniqueId); if (m_BaseUnit != null) { m_BaseCharaMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)m_BaseUnit.id); //進化前アイコン m_UnitBGPanel.setupBaseUnit(m_BaseCharaMaster, m_BaseUnit); m_CharaEvol = MasterDataUtil.GetCharaEvolParamFromCharaID(m_BaseUnit.id); m_AfterCharaMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)m_CharaEvol.unit_id_after); //進化後アイコン m_UnitBGPanel.setupEvolveUnit(m_AfterCharaMaster, m_BaseUnit); //進化後名前 m_UnitStatusPanel.setup(m_AfterCharaMaster, m_BaseUnit); //素材設定 { //素材表示ON UnityUtil.SetObjectEnabledOnce(m_UnitMaterialPanel.gameObject, true); m_UnitMaterialPanel.MaterialList.Clear(); m_UnitMaterialPanel.ObjectList.Clear(); m_UnitMaterialPanel.PanelColor = Color.clear; int _materialCount = 0; //進化素材情報設定 if (m_CharaEvol.unit_id_parts1 != 0) { m_UnitMaterialPanel.addItem(_materialCount++, m_CharaEvol.unit_id_parts1, SelectMaterialUnit, true); } if (m_CharaEvol.unit_id_parts2 != 0) { m_UnitMaterialPanel.addItem(_materialCount++, m_CharaEvol.unit_id_parts2, SelectMaterialUnit, true); } if (m_CharaEvol.unit_id_parts3 != 0) { m_UnitMaterialPanel.addItem(_materialCount++, m_CharaEvol.unit_id_parts3, SelectMaterialUnit, true); } StartCoroutine(WaitSetMaterial()); } //ボタン関連ON m_UnitBGPanel.IsViewExecButton = true; m_UnitBGPanel.IsViewReturnButton = true; m_UnitBGPanel.ExecButtonImage = m_ConfirmSprite; m_UnitBGPanel.IsActiveExecButton = IsEvolveStart(); MainMenuHeader.UnderMsgRequest(GameTextUtil.GetText("un82p_description")); } else { //表示リセット m_UnitBGPanel.Money = 0; m_UnitBGPanel.resetBaseUnit(); m_UnitBGPanel.resetEvolveUnit(); m_UnitStatusPanel.reset(); m_UnitMaterialPanel.MaterialList.Clear(); // m_AfterCharaMaster = null; if (m_CharaEvol != null) { UnitIconImageProvider.Instance.Reset(m_CharaEvol.unit_id_parts1); UnitIconImageProvider.Instance.Reset(m_CharaEvol.unit_id_parts2); UnitIconImageProvider.Instance.Reset(m_CharaEvol.unit_id_parts3); m_CharaEvol = null; } //ボタン関連OFF m_UnitBGPanel.IsViewExecButton = false; m_UnitBGPanel.IsViewReturnButton = false; if (bMaterialReset) { UnityUtil.SetObjectEnabledOnce(m_UnitMaterialPanel.gameObject, false); } else { StartCoroutine(WaitClearMaterial()); } //ベース選択リスト更新 updateBaseUnitList(); } }
private void setupEvol() { if (m_bEvolve) { m_EvolveList.Clear(); m_UnitEvolvePanel.EvolveList.Clear(); AndroidBackKeyManager.Instance.DisableBackKey(); new SerialProcess().Add( (System.Action next) => { //最初の進化先 int nextUnitId = (int)m_UnitId; MasterDataParamChara _masterAfter = m_MainUnitMaster; bool nameView = false; //進化先がなくなるまで追加処理 do { MasterDataParamCharaEvol _evolAfter = MasterDataUtil.GetCharaEvolParamFromCharaID((uint)nextUnitId); EvolveInfo evolveInfo = new EvolveInfo(); evolveInfo.charaMaster = _masterAfter; evolveInfo.evolveMaster = _evolAfter; evolveInfo.charaTexture = null; evolveInfo.nameView = nameView; m_EvolveList.Add(evolveInfo); nameView = true; nextUnitId = -1; if (_evolAfter != null) { _masterAfter = MasterFinder <MasterDataParamChara> .Instance.Find((int)_evolAfter.unit_id_after); if (_masterAfter != null) { nextUnitId = (int)_evolAfter.unit_id_after; } } //同一キャラがすでにリストに登録されていたら検索をやめる if (nextUnitId != -1 && checkEvolveCharaID((uint)nextUnitId) == false) { nextUnitId = -1; } } while (nextUnitId != -1); //ローディング表示開始 LoadingManager.Instance.RequestLoadingStart(LOADING_TYPE.GUARD); next(); }) .Add((System.Action next) => { AssetBundlerMultiplier multi = AssetBundlerMultiplier.Create(); for (int i = 0; i < m_EvolveList.Count; i++) { int no = i; AssetBundler assetBundler = AssetBundler.Create() .SetAsUnitTexture(m_EvolveList[i].charaMaster.fix_id, (o) => { m_EvolveList[no].charaTexture = o.GetTexture2D(TextureWrapMode.Clamp); }); multi.Add(assetBundler); } multi.Load( () =>//Success { next(); }, () =>//Error { next(); }); }) .Add((System.Action next) => { for (int i = 0; i < m_EvolveList.Count; i++) { UnitEvolveContext evolveContext = new UnitEvolveContext(); evolveContext.setup(m_EvolveList[i].charaMaster, m_EvolveList[i].evolveMaster, m_EvolveList[i].charaTexture, m_EvolveList[i].nameView); evolveContext.DidSelectItem = OnSelectSkillButton; m_UnitEvolvePanel.EvolveList.Add(evolveContext); } //ローディング表示終了 LoadingManager.Instance.RequestLoadingFinish(LOADING_TYPE.GUARD); AndroidBackKeyManager.Instance.EnableBackKey(); m_LastUpdateCount = UPDATE_LAYOUT_COUNT; next(); }) .Flush(); } m_Setup[(int)ToggleType.Evolve] = true; }
void CreateSendUnitGetDatas(bool isLink, bool isEvol) { List <PacketStructUnitGetDebug> cUnitGetList = new List <PacketStructUnitGetDebug>(); MasterDataParamChara cCharaMasterData; // ユニットのマスターデータ PacketStructUnitGetDebug cUnitGet; // ユニットデータ MasterDataParamCharaEvol cEvolMasterData; // 進化素材のマスターデータ MasterDataParamChara cCLinkharaMasterData; // リンク素材のマスターデータ int nLimitOverMax; // 限界突破レベルの最大値 for (int i = 0; i < m_DebugGetUnitSelectPanel.Units.Count; i++) { // 選択ユニット追加 if (m_DebugGetUnitSelectPanel.Units[i].unitID == 0) { continue; } cUnitGet = new PacketStructUnitGetDebug(); cUnitGet.id = m_DebugGetUnitSelectPanel.Units[i].unitID; cUnitGet.limitbreak_lv = m_DebugGetUnitSelectPanel.m_UnitGetData.limitbreak_lv; cUnitGet.limitover_lv = m_DebugGetUnitSelectPanel.m_UnitGetData.limitover_lv; cUnitGet.level = m_DebugGetUnitSelectPanel.m_UnitGetData.level; cUnitGet.add_pow = m_DebugGetUnitSelectPanel.m_UnitGetData.add_pow; cUnitGet.add_hp = m_DebugGetUnitSelectPanel.m_UnitGetData.add_hp; cCharaMasterData = MasterDataUtil.GetCharaParamFromID(cUnitGet.id); nLimitOverMax = (int)CharaLimitOver.GetParam(0, cCharaMasterData.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_LIMITOVER_MAX); cUnitGet.limitover_lv = (nLimitOverMax < (int)cUnitGet.limitover_lv) ? (uint)nLimitOverMax : cUnitGet.limitover_lv; cUnitGetList.Add(cUnitGet); // 進化ユニット追加 if (isEvol) { cEvolMasterData = MasterDataUtil.GetCharaEvolParamFromCharaID(cUnitGet.id); if (cEvolMasterData != null) { if (cEvolMasterData.unit_id_parts1 != 0) { PacketStructUnitGetDebug cUnitGetEvol1 = new PacketStructUnitGetDebug(); cUnitGetEvol1.id = cEvolMasterData.unit_id_parts1; cUnitGetEvol1.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetEvol1.level = cUnitGet.level; cUnitGetEvol1.add_hp = cUnitGet.add_hp; cUnitGetEvol1.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetEvol1); } if (cEvolMasterData.unit_id_parts2 != 0) { PacketStructUnitGetDebug cUnitGetEvol2 = new PacketStructUnitGetDebug(); cUnitGetEvol2.id = cEvolMasterData.unit_id_parts2; cUnitGetEvol2.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetEvol2.level = cUnitGet.level; cUnitGetEvol2.add_hp = cUnitGet.add_hp; cUnitGetEvol2.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetEvol2); } if (cEvolMasterData.unit_id_parts3 != 0) { PacketStructUnitGetDebug cUnitGetEvol3 = new PacketStructUnitGetDebug(); cUnitGetEvol3.id = cEvolMasterData.unit_id_parts3; cUnitGetEvol3.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetEvol3.level = cUnitGet.level; cUnitGetEvol3.add_hp = cUnitGet.add_hp; cUnitGetEvol3.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetEvol3); } } } // リンクユニット追加 if (isLink) { cCLinkharaMasterData = MasterDataUtil.GetCharaParamFromID(cUnitGet.id); if (cCLinkharaMasterData != null) { if (cCLinkharaMasterData.link_unit_id_parts1 != 0) { PacketStructUnitGetDebug cUnitGetLink1 = new PacketStructUnitGetDebug(); cUnitGetLink1.id = cCLinkharaMasterData.link_unit_id_parts1; cUnitGetLink1.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetLink1.level = cUnitGet.level; cUnitGetLink1.add_hp = cUnitGet.add_hp; cUnitGetLink1.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetLink1); } if (cCLinkharaMasterData.link_unit_id_parts2 != 0) { PacketStructUnitGetDebug cUnitGetLink2 = new PacketStructUnitGetDebug(); cUnitGetLink2.id = cCLinkharaMasterData.link_unit_id_parts2; cUnitGetLink2.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetLink2.level = cUnitGet.level; cUnitGetLink2.add_hp = cUnitGet.add_hp; cUnitGetLink2.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetLink2); } if (cCLinkharaMasterData.link_unit_id_parts3 != 0) { PacketStructUnitGetDebug cUnitGetLink3 = new PacketStructUnitGetDebug(); cUnitGetLink3.id = cCLinkharaMasterData.link_unit_id_parts3; cUnitGetLink3.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetLink3.level = cUnitGet.level; cUnitGetLink3.add_hp = cUnitGet.add_hp; cUnitGetLink3.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetLink3); } } } } if (cUnitGetList.Count > 0) { //---------------------------------------- // 追加ユニット数を10倍にする //---------------------------------------- if (m_DebugGetUnitSelectPanel.IsMultiplyUnit) { List <PacketStructUnitGetDebug> unitGetMultiplyList = new List <PacketStructUnitGetDebug>(); foreach (PacketStructUnitGetDebug unit in cUnitGetList) { for (int i = 0; i < 10; i++) { PacketStructUnitGetDebug copyUnit = new PacketStructUnitGetDebug(); copyUnit.Copy(unit); unitGetMultiplyList.Add(copyUnit); } } cUnitGetList = unitGetMultiplyList; } //---------------------------------------- // リクエスト開始 //---------------------------------------- if (cUnitGetList.Count > 100 || m_DebugGetUnitSelectPanel.IsMultiplyUnit) { // 10倍すると、かなり数が多くなるので警告を出しておく Dialog newDialog = Dialog.Create(DialogType.DialogYesNo); newDialog.SetDialogText(DialogTextType.Title, "ユニット取得"); newDialog.SetDialogText(DialogTextType.MainText, string.Format("{0}体のユニットを取得しようとしています。\nよろしいですか。", cUnitGetList.Count)); newDialog.SetDialogTextFromTextkey(DialogTextType.YesText, "common_button4"); newDialog.SetDialogTextFromTextkey(DialogTextType.NoText, "common_button5"); newDialog.SetDialogEvent(DialogButtonEventType.YES, () => { SendGetDebugUnit(cUnitGetList.ToArray()); // リクエスト }); newDialog.SetDialogEvent(DialogButtonEventType.NO, () => { }); newDialog.Show(); } else { SendGetDebugUnit(cUnitGetList.ToArray()); // リクエスト } } }
void CreateSendUnitGetDatas(bool isLink, bool isEvol) { List <PacketStructUnitGetDebug> cUnitGetList = new List <PacketStructUnitGetDebug>(); MasterDataParamChara cCharaMasterData; // ユニットのマスターデータ PacketStructUnitGetDebug cUnitGet; // ユニットデータ MasterDataParamCharaEvol cEvolMasterData; // 進化素材のマスターデータ MasterDataParamChara cCLinkharaMasterData; // リンク素材のマスターデータ int nLimitOverMax; // 限界突破レベルの最大値 for (int i = 0; i < Units.Count; i++) { // 選択ユニット追加 if (Units[i].UnitGetData.id == 0) { continue; } cUnitGet = Units[i].UnitGetData; cCharaMasterData = MasterDataUtil.GetCharaParamFromID(cUnitGet.id); nLimitOverMax = (int)CharaLimitOver.GetParam(0, cCharaMasterData.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_LIMITOVER_MAX); cUnitGet.limitover_lv = (nLimitOverMax < (int)cUnitGet.limitover_lv) ? (uint)nLimitOverMax : cUnitGet.limitover_lv; cUnitGetList.Add(cUnitGet); // 進化ユニット追加 if (isEvol) { cEvolMasterData = MasterDataUtil.GetCharaEvolParamFromCharaID(cUnitGet.id); if (cEvolMasterData != null) { if (cEvolMasterData.unit_id_parts1 != 0) { PacketStructUnitGetDebug cUnitGetEvol1 = new PacketStructUnitGetDebug(); cUnitGetEvol1.id = cEvolMasterData.unit_id_parts1; cUnitGetEvol1.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetEvol1.level = cUnitGet.level; cUnitGetEvol1.add_hp = cUnitGet.add_hp; cUnitGetEvol1.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetEvol1); } if (cEvolMasterData.unit_id_parts2 != 0) { PacketStructUnitGetDebug cUnitGetEvol2 = new PacketStructUnitGetDebug(); cUnitGetEvol2.id = cEvolMasterData.unit_id_parts2; cUnitGetEvol2.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetEvol2.level = cUnitGet.level; cUnitGetEvol2.add_hp = cUnitGet.add_hp; cUnitGetEvol2.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetEvol2); } if (cEvolMasterData.unit_id_parts3 != 0) { PacketStructUnitGetDebug cUnitGetEvol3 = new PacketStructUnitGetDebug(); cUnitGetEvol3.id = cEvolMasterData.unit_id_parts3; cUnitGetEvol3.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetEvol3.level = cUnitGet.level; cUnitGetEvol3.add_hp = cUnitGet.add_hp; cUnitGetEvol3.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetEvol3); } } } // リンクユニット追加 if (isLink) { cCLinkharaMasterData = MasterDataUtil.GetCharaParamFromID(cUnitGet.id); if (cCLinkharaMasterData != null) { if (cCLinkharaMasterData.link_unit_id_parts1 != 0) { PacketStructUnitGetDebug cUnitGetLink1 = new PacketStructUnitGetDebug(); cUnitGetLink1.id = cCLinkharaMasterData.link_unit_id_parts1; cUnitGetLink1.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetLink1.level = cUnitGet.level; cUnitGetLink1.add_hp = cUnitGet.add_hp; cUnitGetLink1.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetLink1); } if (cCLinkharaMasterData.link_unit_id_parts2 != 0) { PacketStructUnitGetDebug cUnitGetLink2 = new PacketStructUnitGetDebug(); cUnitGetLink2.id = cCLinkharaMasterData.link_unit_id_parts2; cUnitGetLink2.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetLink2.level = cUnitGet.level; cUnitGetLink2.add_hp = cUnitGet.add_hp; cUnitGetLink2.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetLink2); } if (cCLinkharaMasterData.link_unit_id_parts3 != 0) { PacketStructUnitGetDebug cUnitGetLink3 = new PacketStructUnitGetDebug(); cUnitGetLink3.id = cCLinkharaMasterData.link_unit_id_parts3; cUnitGetLink3.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetLink3.level = cUnitGet.level; cUnitGetLink3.add_hp = cUnitGet.add_hp; cUnitGetLink3.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetLink3); } } } } if (cUnitGetList.Count > 0) { SendGetDebugUnit(cUnitGetList.ToArray()); // リクエスト } }
/// <summary> /// 進化画面更新 /// </summary> public void updateEvolveStatus(bool bRenew = false) { if (bRenew) { //ユニットリスト作成 makeUnitList(); //ウインドウ閉じる m_ExpandWindow.Close(true); m_UnitGrid.changeGridWindowSize(false, (m_ExpandWindow != null) ? m_ExpandWindow.ViewHeightSize : 0); //パネルを消す m_UnitBGPanel.IsViewPanel = false; //ソートボタン有効化 m_UnitGrid.IsActiveSortButton = true; //確認OFF m_Validate = false; } if (m_UnitListCount <= 0) { if (m_MaxDialog == null) { m_MaxDialog = Dialog.Create(DialogType.DialogOK); m_MaxDialog.SetDialogTextFromTextkey(DialogTextType.Title, "error_reject_common_title"); m_MaxDialog.SetDialogTextFromTextkey(DialogTextType.MainText, "unit_list_Unowned"); m_MaxDialog.SetDialogTextFromTextkey(DialogTextType.OKText, "common_button1"); m_MaxDialog.SetDialogEvent(DialogButtonEventType.OK, () => { MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_HOME_MENU, false, false); }); m_MaxDialog.DisableCancelButton(); m_MaxDialog.Show(); } } m_BaseUnit = UserDataAdmin.Instance.SearchChara(MainMenuParam.m_EvolveBaseUnitUniqueId); if (m_BaseUnit != null) { m_BaseCharaMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)m_BaseUnit.id); //進化前アイコン m_UnitBGPanel.setupBaseUnit(m_BaseCharaMaster, m_BaseUnit); m_CharaEvol = MasterDataUtil.GetCharaEvolParamFromCharaID(m_BaseUnit.id); m_AfterCharaMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)m_CharaEvol.unit_id_after); //進化後アイコン m_UnitBGPanel.setupEvolveUnit(m_AfterCharaMaster, m_BaseUnit); //進化後名前 m_UnitStatusPanel.setup(m_AfterCharaMaster, m_BaseUnit); //ボタン関連ON m_UnitBGPanel.IsViewExecButton = true; m_UnitBGPanel.IsViewReturnButton = true; m_UnitBGPanel.ExecButtonImage = m_ConfirmSprite; m_UnitBGPanel.IsActiveExecButton = IsEvolveStart(); //ベース選択後リスト更新 updateBaseUnitAfterList(); SetupBlendAfterStatus(); } else { //表示リセット m_UnitBGPanel.Point = 0; m_UnitBGPanel.resetBaseUnit(); m_UnitBGPanel.resetEvolveUnit(); m_UnitStatusPanel.reset(); //ボタン関連OFF m_UnitBGPanel.IsViewExecButton = false; m_UnitBGPanel.IsViewReturnButton = false; //ベース選択リスト更新 updateBaseUnitList(); } }
public void setup(uint unit_id, PacketStructUnit _mainUnit, PacketStructUnit _subUnit, Image Chara, Image Shadow) { lvMax = false; charaMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)unit_id); m_UnitId = unit_id; m_mainUnit = _mainUnit; m_subUnit = _subUnit; CharaOnce charaOnce = setParam(); if (_mainUnit == null) { IsExpActive = false; linkButtonEnable = false; LinkButtonColor = Color.gray; } else { //----------------------- // 次のレベルまでの経験値を算出 //----------------------- int nNowLevelExp = CharaUtil.GetStatusValue(charaMaster, (int)_mainUnit.level, CharaUtil.VALUE.EXP); int nNextLevelExp = CharaUtil.GetStatusValue(charaMaster, (int)_mainUnit.level + 1, CharaUtil.VALUE.EXP); int nLevelupExp = nNextLevelExp - nNowLevelExp; int nNextEXP = 0; float expRatio = 0.0f; if (nLevelupExp > 0) { nNextEXP = nNextLevelExp - (int)_mainUnit.exp; expRatio = (float)(nLevelupExp - nNextEXP) / nLevelupExp; } NextExp = nNextEXP; ExpRate = expRatio; IsExpActive = true; } CharaSprite = Chara.sprite; CharaMaterial = Chara.material; ShadowSprite = Shadow.sprite; ShadowMaterial = Shadow.material; CharaSpriteWidth = CharaSprite.texture.GetUnitTextureWidth(); CharaSpriteHeight = CharaSprite.texture.GetUnitTextureHeight(); ProfileMessage = charaMaster.detail.ReplaceSpaceTag(29).NoLineBreakTag(); IsViewMaterialPanel = false; IsViewFloatWindow = false; MasterDataParamCharaEvol _evolAfter = MasterDataUtil.GetCharaEvolParamFromCharaID(unit_id); if (_evolAfter != null) { IsViewMaterialPanel = true; MaterialValue = ""; MaterialList.Clear(); MaterialLabelX = 108; if (_evolAfter.unit_id_parts1 != 0) { addMaterial(_evolAfter.unit_id_parts1); MaterialLabelX += 64; } if (_evolAfter.unit_id_parts2 != 0) { addMaterial(_evolAfter.unit_id_parts2); MaterialLabelX += 64; } if (_evolAfter.unit_id_parts3 != 0) { addMaterial(_evolAfter.unit_id_parts3); MaterialLabelX += 64; } if (_evolAfter.unit_id_parts4 != 0) { addMaterial(_evolAfter.unit_id_parts4); MaterialLabelX += 64; } } ScrollRect srect = GetComponentInChildren <ScrollRect>(); if (srect != null) { srect.verticalNormalizedPosition = 1; } }