Ok. So Here are these Errors:
Attribute.cs:
public class Attribute : BaseStat {
public Attribute() {
ExpToLevel = 50;
LevelModifier = 1.05f;
}
}
public enum AttributeName {
Power,
Speed,
Intelligent,
Fight,
Explore
}
BaseStat.cs:
public class BaseStat {
private int _baseValue; //the base value of this stat
private int _buffValue; // the amount of the buff to this stat
private int _expToLevel; //the total amount of exp needed to raise this skill
private float _levelModifier; // the modifier applied to the exp needed to raise the skill
public BaseStat() {
_baseValue = 0;
_buffValue = 0;
_levelModifier = 1.1f;
_expToLevel = 100;
}
#region Basic Setters and Getters
//Basic Setters and Getters
public int BaseValue {
get{ return _baseValue; }
set{ _baseValue = value; }
}
public int BuffValue {
get{ return _buffValue; }
set{ _buffValue = value; }
}
public int ExpToLevel {
get{ return _expToLevel; }
set{ _expToLevel = value; }
}
public float LevelModifier {
get{ return _levelModifier; }
set{ _levelModifier = value; }
}
#endregion
public int CalculateExpToLevel() {
return (int)(ExpToLevel * _levelModifier);
}
public void LevelUp() {
_expToLevel = CalculateExpToLevel();
_baseValue++;
}
public int AdjustedBaseValue {
get{ return _baseValue + _buffValue; }
}
}
ModifiedStat.cs:
using System.Collections.Generic;
public class ModifiedStat : BaseStat {
private List<ModifyingAttribute> _mods;
private int _modValue;
public ModifiedStat() {
_mods = new List<ModifyingAttribute>();
_modValue = 0;
}
public void AddModifier( ModifyingAttribute mod) {
_mods.Add(mod);
}
private void CalculateModValue() {
_modValue = 0;
if(_mods.Count > 0)
foreach(ModifyingAttribute att in _mods)
_modValue += (int)(att.Attribute.AdjustedValue * att.ratio);
}
public new int AdjustBaseValue {
get{ return _baseValue + _buffValue + _modValue; }
}
public void Update() {
CalculateModValue();
}
}
public struct ModifyingAttribute {
public Attribute attribute;
public float ratio;
}
WARNING 1, Assets/Scripts/Character Classes/ModifiedStat.cs(24,24): warning CS0109: The member `ModifiedStat.AdjustBaseValue’ does not hide an inherited member. The new keyword is not required
ERROR 1, Assets/Scripts/Character Classes/ModifiedStat.cs(25,29): error CS0122: `BaseStat._baseValue’ is inaccessible due to its protection level
ERROR 2, Assets/Scripts/Character Classes/ModifiedStat.cs(21,56): error CS1061: Type ModifyingAttribute' does not contain a definition for
Attribute’ and no extension method Attribute' of type
ModifyingAttribute’ could be found (are you missing a using directive or an assembly reference?)
I’ve been Trying to Fix These Errors All the TIME! Can’t figure it out ._.