private void Awake() { if (_unitHealth == null) { _unitHealth = GetComponent <HealthChanger>(); } }
private void Start() { fuel = 100; scoreChanger += UpdateStats; healthChanger += ChangeHealthvalue; scoreChanger(); healthChanger(); thrusterSlider.value = 0; StartCoroutine(PlayingTime()); UpdateFuelAmount(0); UpdateThrottle(); }
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); } } }