// ステータスをセーブ用にコピー public void StatusCopy(AllyStatus allyStatus) { // キャラクターの名前 this.characterName = allyStatus.GetCharacterName(); // 毒状態かどうか this.isPoisonState = allyStatus.IsPoisonState(); // 痺れ状態かどうか this.isNumbnessState = allyStatus.IsNumbnessState(); // キャラクターのレベル this.level = allyStatus.GetLevel(); // 素早さ this.agility = allyStatus.GetAgility(); // 力 this.power = allyStatus.GetPower(); // 打たれ強さ this.strikingStrength = allyStatus.GetStrikingStrength(); // 魔法力 this.magicPower = allyStatus.GetMagicPower(); // 攻撃力 this.attackPower = allyStatus.GetAttackPower(); // 守備力 this.defencePower = allyStatus.GetDefencePower(); // 最大HP this.maxHp = allyStatus.GetMaxHp(); // HP this.hp = allyStatus.GetHp(); // 最大MP this.maxMp = allyStatus.GetMaxMp(); // MP this.mp = allyStatus.GetMp(); // 持っているスキル this.skillList = allyStatus.GetSkillList(); //属性カット率 this.cutFlame = allyStatus.GetCutFlame(); this.cutThunder = allyStatus.GetCutThunder(); this.cutIce = allyStatus.GetcutIce(); // 獲得経験値 this.earnedExperience = allyStatus.GetEarnedExperience(); // 装備している武器 this.equipWeapon = allyStatus.GetEquipWeapon(); // 装備している鎧 this.equipArmor = allyStatus.GetEquipArmor(); //装備しているアクセサリ this.equipAccessory1 = allyStatus.GetEquipAccessory1(); this.equipAccessory2 = allyStatus.GetEquipAccessory2(); }
// 装備の更新 public void UpdateEquip() { // 装備の種類ごとに装備を更新する if (chengingEquipType == EquipType.Weapon) { UnequipItemNumSet(changingEquipmentCharacter.GetEquipWeapon()); changingEquipmentCharacter.SetEquipWeapon(selectEquipment as Weapon); } else if (chengingEquipType == EquipType.Armor) { UnequipItemNumSet(changingEquipmentCharacter.GetEquipArmor()); changingEquipmentCharacter.SetEquipArmor(selectEquipment as Armor); } else if (chengingEquipType == EquipType.Accessory1) { UnequipItemNumSet(changingEquipmentCharacter.GetEquipAccessory1()); changingEquipmentCharacter.SetEquipAccessory1(selectEquipment as Accessory); } else if (chengingEquipType == EquipType.Accessory2) { UnequipItemNumSet(changingEquipmentCharacter.GetEquipAccessory2()); changingEquipmentCharacter.SetEquipAccessory2(selectEquipment as Accessory); } // 防御力と攻撃力を更新 changingEquipmentCharacter.SetEquippedAttackPower(); changingEquipmentCharacter.SetEquippedDefencePower(); // 装備したアイテム数を減らす EquipItemNumSet(selectEquipment); // 装備変更ボタンの更新 UpdateEquipButton(changingEquipmentCharacter); //選択アイテム一覧の子要素を全て削除 EquipmentItemClear(); equipmentSelectPanel.SetActive(false); okButton.GetComponent <Button>().interactable = false; ReturnToTopButton.GetComponent <Button>().interactable = true; }
// 装備ボタンの更新 public void UpdateEquipButton(AllyStatus allyStatus) { AllyStatusDictionary[allyStatus].Find("CharacterNamePanel/CharacterName").GetComponent <Text>().text = allyStatus.GetCharacterName(); AllyStatusDictionary[allyStatus].Find("StatusParamPanel/HPText").GetComponent <Text>().text = "HP: " + allyStatus.GetHp().ToString() + "/" + allyStatus.GetMaxHp().ToString(); AllyStatusDictionary[allyStatus].Find("StatusParamPanel/MPText").GetComponent <Text>().text = "MP: " + allyStatus.GetMp().ToString() + "/" + allyStatus.GetMaxMp().ToString(); AllyStatusDictionary[allyStatus].Find("StatusParamPanel/AttackPowerText").GetComponent <Text>().text = "攻撃力: " + allyStatus.GetAttackPower().ToString(); AllyStatusDictionary[allyStatus].Find("StatusParamPanel/DefencePowerText").GetComponent <Text>().text = "守備力: " + allyStatus.GetDefencePower().ToString(); AllyStatusDictionary[allyStatus].Find("StatusParamPanel/PowerText").GetComponent <Text>().text = "力: " + allyStatus.GetPower().ToString(); AllyStatusDictionary[allyStatus].Find("StatusParamPanel/StrikingStrengthText").GetComponent <Text>().text = "体力: " + allyStatus.GetStrikingStrength().ToString(); AllyStatusDictionary[allyStatus].Find("StatusParamPanel/MagicPowerText").GetComponent <Text>().text = "知力: " + allyStatus.GetMagicPower().ToString(); AllyStatusDictionary[allyStatus].Find("StatusParamPanel/AgilityText").GetComponent <Text>().text = "素早さ: " + allyStatus.GetAgility().ToString(); AllyStatusDictionary[allyStatus].Find("ChangeWeaponPanel/ChangeEquipButton").Find("Text").GetComponent <Text>().text = allyStatus.GetEquipWeapon() ? allyStatus.GetEquipWeapon().GetKanjiName() : "なし"; AllyStatusDictionary[allyStatus].Find("ChangeArmorPanel/ChangeEquipButton").Find("Text").GetComponent <Text>().text = allyStatus.GetEquipArmor() ? allyStatus.GetEquipArmor().GetKanjiName() : "なし"; AllyStatusDictionary[allyStatus].Find("ChangeAccessoryPanel1/ChangeEquipButton").Find("Text").GetComponent <Text>().text = allyStatus.GetEquipAccessory1() ? allyStatus.GetEquipAccessory1().GetKanjiName() : "なし"; AllyStatusDictionary[allyStatus].Find("ChangeAccessoryPanel2/ChangeEquipButton").Find("Text").GetComponent <Text>().text = allyStatus.GetEquipAccessory2() ? allyStatus.GetEquipAccessory2().GetKanjiName() : "なし"; }