public void ShowDamage(float damage)
 {
     if (_healthBar == null)
     {
         SpawnHealthBar();
     }
     _healthBar.Damaged(_currHealth);
 }
Exemple #2
0
    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);
    }