Exemplo n.º 1
0
 void Start()
 {
     detectionComponent  = GetComponent <DetectionComponent>();
     navigationComponent = GetComponent <NavigationComponent>();
     gunComponent        = GetComponent <Gun>();
     healthComponent     = GetComponent <HealthComponent>();
     healthComponent.RestoreHealth(100);
 }
Exemplo n.º 2
0
    public void Setup(DetectionComponent detectionComponent, float speedRotation)
    {
        _detectionComponent = detectionComponent;
        _detectionComponent.OnDetectedTarget     += SetTarget;
        _detectionComponent.OnDetectedTargetLose += CleanTarget;

        _speedRotation = speedRotation;

        _enable = true;
    }
Exemplo n.º 3
0
    public void Setup(DetectionComponent detectionComponent, Weapon weapon, float delayToStartFiring)
    {
        _detectionComponent = detectionComponent;
        _detectionComponent.OnDetectedTarget     += EnableFire;
        _detectionComponent.OnDetectedTargetLose += DisableFire;

        _weapon = weapon;

        _delayToStartFiring = delayToStartFiring;

        _enable = true;
    }
Exemplo n.º 4
0
    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;
    }