Esempio n. 1
0
 private void Awake()
 {
     if (_unitHealth == null)
     {
         _unitHealth = GetComponent <HealthChanger>();
     }
 }
Esempio n. 2
0
    private void Start()
    {
        fuel           = 100;
        scoreChanger  += UpdateStats;
        healthChanger += ChangeHealthvalue;

        scoreChanger();
        healthChanger();
        thrusterSlider.value = 0;
        StartCoroutine(PlayingTime());
        UpdateFuelAmount(0);
        UpdateThrottle();
    }
Esempio n. 3
0
    public override void Execute(GameObject actor)
    {
        HealthChanger actorHealth = actor.GetLevelObjectComponent <HealthChanger>();

        if (actorHealth != null)
        {
            Fraction actorFraction = actor.GetFraction();

            if (actorFraction.IsHittableBy(CurrentFraction))
            {
                actorHealth.Hit(_damageSkill.DamageValue, _hitType);
                _onAfterHitCommand.Execute(actor);
            }
        }
    }