public void ShowDamage(float damage) { if (_healthBar == null) { SpawnHealthBar(); } _healthBar.Damaged(_currHealth); }
public void ShowDamage(float damage) { GameObject p = Instantiate(_fadePointsPrefab, CanvasManager.Instance.MainCanvas.transform); FadePoints fp = p.GetComponent <FadePoints>(); fp.TextColor = _pointsColor; fp.Points = damage; fp.MaxRandom = _maxRandomPointsPos; fp.TargetTransform = gameObject.transform; fp.Offset = _pointsOffset; if (_towerHealthBar == null) { SpawnHealthBar(); } _towerHealthBar.Damaged(_currHealth); }