// All NPCs start at level 1. They can have their level increased through the LevelUp() method, which can only be called by this class // Optionally, multiple level ups can be performed sequentially by passing an integer value to the LevelUp() method private void LevelUp(int NumberOfLevels = 1) { this.Level = this.Level + NumberOfLevels; foreach (Stat LevelUpStat in StatBlock) { Console.WriteLine("Calling Grow on: " + LevelUpStat.Name); LevelUpStat.Grow(); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); LevelUpStat statScript = (LevelUpStat)target; if (GUILayout.Button("Increase")) { statScript.Increase(); } }