protected virtual void Start() { if (properties == null) { baseTower = GameData.instance.GetTower(type, level); TowerProperties baseProperties = new TowerProperties(); baseProperties.Load(type, level); properties = new TowerPropertiesQueue(); properties.Initialize(baseProperties, Time.time); } SetRange(); online = true; //assign the towerRange to the sphere collider radius this.GetComponent <SphereCollider>().radius = 2 * (float)properties.active.range; extradamage = 0; nextFireTime = Time.time + (float)properties.active.rateOfFire; healthBar = UIManager.instance.GetHealthBar(); healthBar.UpdateName("Tower: " + type); healthBar.UpdateGUI(transform.position, properties.active.hp / properties.active.maxHp, 4); }
protected virtual void Awake() { properties = null; }