Beispiel #1
0
 protected override void Die()
 {
     StopAllCoroutines();
     FindObjectOfType <WaveController>().CountKill(_reward);
     Gold.Add(_reward);
     Destroy(gameObject);
 }
Beispiel #2
0
 public void Add(int crop, int gold, int iron, int wood, int labor)
 {
     BeginUpdate();
     Crop.Add(crop);
     Gold.Add(gold);
     Wood.Add(wood);
     Iron.Add(iron);
     Labor.Add(labor);
     EndUpdate();
 }
Beispiel #3
0
    public void AddGold(string name, long value)
    {
        if (Capacity + value <= MaxCapacity)
        {
            if (!Gold.Any(g => g.Name == name))
            {
                Gold.Add(new Gold(name));
            }

            var current = Gold.FirstOrDefault(g => g.Name == name);
            current.Value += value;
            Capacity      += value;
        }
    }