void Start() { detectionComponent = GetComponent <DetectionComponent>(); navigationComponent = GetComponent <NavigationComponent>(); gunComponent = GetComponent <Gun>(); healthComponent = GetComponent <HealthComponent>(); healthComponent.RestoreHealth(100); }
public void Setup(DetectionComponent detectionComponent, float speedRotation) { _detectionComponent = detectionComponent; _detectionComponent.OnDetectedTarget += SetTarget; _detectionComponent.OnDetectedTargetLose += CleanTarget; _speedRotation = speedRotation; _enable = true; }
public void Setup(DetectionComponent detectionComponent, Weapon weapon, float delayToStartFiring) { _detectionComponent = detectionComponent; _detectionComponent.OnDetectedTarget += EnableFire; _detectionComponent.OnDetectedTargetLose += DisableFire; _weapon = weapon; _delayToStartFiring = delayToStartFiring; _enable = true; }
private void Awake() { Health = GetComponent <HealthController>(); if (Health != null) { Health.SetMaxHealth(_data.MaxHealth); Health.OnDead += Dead; } _detectionComponent = GetComponent <DetectionComponent>(); _aimingComponent = GetComponent <AimingComponent>(); _firingComponent = GetComponent <FiringComponent>(); _weapon = GetComponent <Weapon>(); GameEventsManager.OnPlayerDead += DeactivateComponents; }