Greetings,
Hoping somebody can nudge me in the right direction because I am going around in circles and unsure of what I am doing wrong.
I am trying to create a base class for stats, and then using that class create some player stats, economy stats, etc in different scripts that derivce from the main stat class.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
class Stat
{
private string StatName;
private int StatSlot;
private float StatXP;
private int BaseValue;
private int MinValue;
private int MaxValue;
private int CurrentValue;
private int FinalValue;
// Constructor with Input Paramters for 'Standard' stat class.
[System.Serializable]
public Stat(string _statname, int _statslot, float _statxp, int _basevalue, int _minvalue, int _maxvalue, int _currentvalue, int _finalvalue)
{
StatName = _statname;
StatSlot = _statslot;
StatXP = _statxp;
BaseValue = _basevalue;
MaxValue = _maxvalue;
MinValue = _minvalue;
CurrentValue = _currentvalue;
FinalValue = _finalvalue;
}
}
Then in a sepeate player stats class - I am trying to create a new stat - that lets me set adjust these values on a per stat basis.
E.g for Stamina
public Stat Stamina = new Stat(āStamina,1,0,0,0,0,0ā);
Which would be a new stat called Stamina, with a stat slot of 0, 0xp, 0 base value, 0 max value, 0 min value, 0 current value and 0 final value.
I would like to be able to write in the player stats script
New Stat Stamina
New Stat Strength
etc
Then be able to adjust each stats parameters.
I am clearly doingn something wrong but Iām confused about where I am going wrong.
Any pointers would be greatly appreciated.
Thank You for any help you can offer.