public BulletPartsInfo(UserPartsData partsData) : base(partsData) { this.master = Masters.BulletDB.FindById(partsData.itemId); var gearCount = partsData.gearMasterIds.Length; // 装着中のギアの能力値 for (int i = 0; i < gearCount; i++) { this.gearMaster = Masters.GearDB.FindById(partsData.gearMasterIds[i]); this.gearFvPointGetValue = +this.gearMaster.fvPoint; this.gearBulletSpeed += this.gearMaster.speed; this.gearPower += this.gearMaster.power; } }
/// <summary> /// ギア情報のセット /// </summary> public void SetGearData(Master.GearData gearData) { if (gearData == null) { this.icon.gameObject.SetActive(false); this.nameText.gameObject.SetActive(false); } else { this.icon.SetGearCommonIcon(true); ; this.icon.SetRank((Rank)gearData.rarity); this.nameText.text = gearData.name; this.notEquipedText.gameObject.SetActive(false); // ギアスプライトセット var bgSprite = CommonIconUtility.GetGearBgSprite(gearData.partsType); var mainSprite = CommonIconUtility.GetGearMainImageSprite(gearData.key); var subSprite = CommonIconUtility.GetGearSubImageSprite(gearData.subKey); this.icon.SetGearSprite(bgSprite, mainSprite, subSprite); } }
/// <summary> /// セットアップ /// </summary> public void Setup( SimpleDialog dialog, UserPartsData partsData, UserGearData beforeGear, UserGearData afterGear, Action onReflesh, Action onCancel) { this.dialog = dialog; this.yesNo = this.dialog.AddYesNoButton(); this.partsData = partsData; this.beforeGear = beforeGear; this.afterGear = afterGear; this.onReflesh = onReflesh; this.onCancel = onCancel; //キャンセル時処理登録 this.yesNo.no.onClick = this.Cancel; Master.GearData beforeGearData = (this.beforeGear == null) ? null : Masters.GearDB.FindById(beforeGear.gearId); Master.GearData afterGearData = (this.afterGear == null) ? null : Masters.GearDB.FindById(afterGear.gearId); this.beforeGearPanel.SetGearData(beforeGearData); this.afterGearPanel.SetGearData(afterGearData); //所持コイン数テキスト long beforeCoin = (long)UserData.Get().coin; this.beforeCoinText.text = string.Format("{0:#,0}", beforeCoin); //装着 if (beforeGearData == null) { this.coinArea.SetActive(false); this.confirmText.text = Masters.LocalizeTextDB.Get("ConfirmGearEquip"); this.noteRemoveCostText.text = Masters.LocalizeTextDB.GetFormat("NoteGearRemoveCost", afterGearData.rejectCoin); this.freeGearRemoveText.text = null; this.yesNo.yes.onClick = this.CallGearSetApi; } else { this.noteRemoveCostText.gameObject.SetActive(false); // vipでない場合 if (UserData.Get().vipLevel == 0) { this.freeGearRemoveText.gameObject.SetActive(false); } else { this.freeGearRemoveText.gameObject.SetActive(true); } if (CustomGearConfirmDialogContent.freeGearRemoveCount > 0) { // 無料カウントがある場合、beforeCoinはafterCoinTextと同じ this.afterCoinText.text = string.Format("{0:#,0}", beforeCoin); } else { this.afterCoinText.text = string.Format("{0:#,0}", beforeCoin - beforeGearData.rejectCoin); if (beforeCoin - beforeGearData.rejectCoin < 0) { this.afterCoinText.color = UIUtility.decreaseColor; } } //外す if (afterGearData == null) { this.confirmText.text = Masters.LocalizeTextDB.Get("ConfirmGearRemove"); this.yesNo.yes.onClick = this.CallGearUnsetApi; this.freeGearRemoveText.text = Masters.LocalizeTextDB.GetFormat("FreeGearRemove", CustomGearConfirmDialogContent.freeGearRemoveCount); } //変更 else { this.confirmText.text = Masters.LocalizeTextDB.Get("ConfirmGearChange"); this.yesNo.yes.onClick = this.CallGearChageApi; this.freeGearRemoveText.text = Masters.LocalizeTextDB.GetFormat("FreeGearRemove", CustomGearConfirmDialogContent.freeGearRemoveCount); } //コイン不足・無料回数が0 if (beforeGearData.rejectCoin > beforeCoin && CustomGearConfirmDialogContent.freeGearRemoveCount <= 0) { //ボタン押せなくしてグレースケールに this.yesNo.yes.button.interactable = false; this.yesNo.yes.image.material = SharedUI.Instance.grayScaleMaterial; this.yesNo.yes.text.material = SharedUI.Instance.grayScaleMaterial; this.freeGearRemoveText.text = Masters.LocalizeTextDB.GetFormat("FreeGearRemove", CustomGearConfirmDialogContent.freeGearRemoveCount); } } }