Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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();
        }