Пример #1
0
    // Use this for initialization
    void Start()
    {
        animator    = GetComponent <Animator>();
        lightAttack = GetComponent <MeleeAttackAgent>();
        playerInput = GetComponent <PlayerInput>();

        playerInput.onDirectionalInputChange += OnDirectionalInputChange;
        lightAttack.onAttackStart            += OnAttackStart;
        lightAttack.onAttackComplete         += OnAttackComplete;
    }
Пример #2
0
    // Start is called before the first frame update
    void Start()
    {
        controller            = GetComponent <Controller2D>();
        hitbox                = GetComponent <Hitbox>();
        hitbox.onDamageTaken += OnDamageTaken;

        lightAttack = GetComponent <MeleeAttackAgent>();
        lightAttack.Init(enemyCollisionMask, controller.collisionMask);

        heavyAttack = GetComponent <ExtendedAttackAgent>();
        heavyAttack.Init(enemyCollisionMask, controller.collisionMask);

        RecalculateMovementSettings();
    }