private void Start()
    {
        MovementModule = GetComponent <MovementModule_Navigation>();
        if (MovementModule)
        {
            if (ImplementWalking)
            {
                MovementModule.OnMovementModuleDisabled += SetWalkingToFalse;
                MovementModule.OnMovementModuleEnabled  += SetWalkingToTrue;
            }
        }

        if (AnimationEvents)
        {
            AnimationEvents.OnAttackEnded            += AttackEndedAnimationEvent;
            AnimationEvents.OnHitAnimationEnd        += HitAnimationEndAnimationEvent;
            AnimationEvents.OnDeathAnimationEnd      += DeathAnimationEndAnimationEvent;
            AnimationEvents.OnActivationAnimationEnd += ActivationAnimationEndAnimationEvent;
        }

        HealthController        = GetComponent <HealthController>();
        HealthController.OnDie += Die;
        if (ImplementTakeHit)
        {
            HealthController.OnDamageWithPosition += TakeDamage;
        }
    }
Example #2
0
 void Start()
 {
     MovementModule   = GetComponent <MovementModule_Navigation>();
     AnimationModule  = GetComponent <AnimationModule_Enemy>();
     HealthController = GetComponent <HealthController>();
     if (HealthController)
     {
         HealthController.OnDie += Die;
     }
     if (currentState == null)
     {
         SetState(new ActivationState(this));
     }
 }
Example #3
0
    protected void Start()
    {
        RotationModule   = GetComponent <RotationModule_Enemy>();
        MovementModule   = GetComponent <MovementModule_Navigation>();
        AttackModule     = GetComponent <AttackModule_Enemy>();
        HealthController = GetComponent <HealthController>();
        if (HealthController)
        {
            HealthController.OnDie += Die;
        }


        if (currentState == null)
        {
            SetState(new InativeState(this));
        }
    }