I’m a trying to make a ScriptableObject that outlines a buff for the stats of a character. That looks about like this:
public class StatBuff : StatusEffect {
public int buffStrength;
public override void ApplyEffect(Character character) {
character.GetStats().stamina.AddModifier(buffStrength);
}
public override void EndEffect(Character character) {
character.GetStats().stamina.RemoveModifier(buffStrength);
}
}
The GetStats() method returns the character’s instance of the CharacterStats class, which defines which stats a character should have.
I want to be able to choose which stat from the CharacterStats class (stamina being an example) I would like to buff from the inspector, so that I don’t have to make a different ScriptableObject for each stat in the CharacterStats class. I would imagine this would involve getting the attributes/fields of the CharacterStats class and listing them in a drop box, but I do not know how to do this. I was thinking this might involve creating a custom editor for the StatBuff class, but I have very little experience writing custom editors. How might I do this? Do I need to use a custom editor?
Thanks in advance.