public Upgrade(StatsSet set) { _price = set.getInt("price"); _attackBoost = set.getFloat("attackBoost"); _attackSpeedBoost = set.getFloat("speedBoost"); _rangeBoost = set.getFloat("rangeBoost"); _healthBoost = set.getFloat("healthBoost"); _newAmmunition = set.getObject("ammunition") as Ammunition; _graphicsUpgrade = set.getObject("graphicsUpgrade") as Dictionary <int, Color>; }
public GameTower(StatsSet set) : base(set) { _attackFrequency = set.getFloat("attackFrequency"); _damagePerAttack = set.getFloat("attackDamage"); _attackRange = set.getFloat("attackRange"); _health = set.getFloat("health"); _ammunition = set.getObject("ammunition") as Ammunition; _coinPrice = set.getInt("coinPrice"); _attackPS = set.getString("attackParticleSystem"); _attackSound = set.getString("attackSound"); _repairCostPerPS = set.getFloat("repairCostPerPS"); _fracturedAsset = Resources.Load("Models/" + set.getString("fracturedAssetPath")); _towerIconAsset = Resources.Load(set.getString("towerIcon"), typeof(Sprite)) as Sprite; }
private void addGraphicsUpdate(StatsSet s, int index, Color c) { Dictionary <int, Color> graphics = s.getObject("graphicsUpgrade") as Dictionary <int, Color>; if (graphics == null) { graphics = new Dictionary <int, Color> (); graphics.Add(index, c); s.set("graphicsUpgrade", graphics); } else if (graphics.ContainsKey(index)) { graphics [index] = c; } else { graphics.Add(index, c); } }