public bool Add(FpsStat stat) { if (Has(stat.Id)) { Debug.LogErrorFormat("Object {0} already has a stat with ID {1}", gameObject.name, stat.Id); return(false); } _stats.Add(stat); //Debug.LogFormat("{0}: Add {1}", gameObject.name, stat.ToString()); return(true); }
public void Adjust(string id, int amount) { FpsStat stat = GetStat(id); if (stat == null) { Debug.LogErrorFormat("Object {0} does not have a stat with ID {1}", gameObject.name, id); return; } stat.Value += amount; }
public void Reset(string id) { FpsStat stat = GetStat(id); if (stat == null) { Debug.LogErrorFormat("Object {0} does not have a stat with ID '{1}'", gameObject.name, id); return; } stat.Reset(); }