protected override void Die() { StopAllCoroutines(); FindObjectOfType <WaveController>().CountKill(_reward); Gold.Add(_reward); Destroy(gameObject); }
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(); }
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; } }