/// <summary>Method called externally through buttons to set the class stats for the selected character</summary> /// <param name="startingClass_">The reference to the ClassSelectorButton to use for the character</param> public void SetClassOfSelectedCharacter(ClassSelectorButton startingClass_) { //Setting the class stats to the character of the index we already have selected switch (this.selectedCharIndex) { case 0: this.char0ClassStats = startingClass_; this.char0ClassNameText.text = startingClass_.classNameText.text; break; case 1: this.char1ClassStats = startingClass_; this.char1ClassNameText.text = startingClass_.classNameText.text; break; case 2: this.char2ClassStats = startingClass_; this.char2ClassNameText.text = startingClass_.classNameText.text; break; case 3: this.char3ClassStats = startingClass_; this.char3ClassNameText.text = startingClass_.classNameText.text; break; default: break; } }
/// <summary>Displays information about the given class</summary> /// <param name="classRef_">The ClassSelectorButton that contains the info to display</param> public void DisplayClassInfo(ClassSelectorButton classRef_) { this.classNameText.text = classRef_.classNameText.text; //The string that will be displayed in the classInfoText string textToDisplay = classRef_.classDescription; //Displaying all of the equipment textToDisplay += "\n\n - Equipment -\n"; if (classRef_.mainHandWeapon != null) { textToDisplay += "Main-hand weapon: " + classRef_.mainHandWeapon.gameObject.name + "\n"; } if (classRef_.offHandWeapon != null) { textToDisplay += "Off-hand weapon: " + classRef_.offHandWeapon.gameObject.name + "\n"; } if (classRef_.helmArmor != null) { textToDisplay += "Helm: " + classRef_.helmArmor.gameObject.name + "\n"; } if (classRef_.bodyArmor != null) { textToDisplay += "Armor: " + classRef_.bodyArmor.gameObject.name + "\n"; } if (classRef_.trinketArmor != null) { textToDisplay += "Trinket: " + classRef_.trinketArmor.gameObject.name + "\n"; } //Displaying all of the inventory items if (classRef_.inventoryItems.Count > 0) { textToDisplay += "\n - Items -\n"; for (int i = 0; i < classRef_.inventoryItems.Count; i++) { textToDisplay += classRef_.inventoryItems[i].itemNameID + "\n"; } } //Displaying the class actions textToDisplay += "\n - Actions -\n"; for (int a = 0; a < classRef_.classActions.Count; a++) { textToDisplay += classRef_.classActions[a].actionName + "\n"; } //Displaying the class perks textToDisplay += "\n - Perks -\n"; for (int p = 0; p < classRef_.classPerks.Count; p++) { textToDisplay += classRef_.classPerks[p].perkNameID + "\n"; } //Displaying the bonus starting HP textToDisplay += "\n - Stats -\n"; if (classRef_.bonusHP > -1) { textToDisplay += "Hit Points: +" + classRef_.bonusHP; } else { textToDisplay += "Hit Points: -" + classRef_.bonusHP; } this.classInfoText.text = textToDisplay; }