Esempio n. 1
0
 private void ImportAttackAttributes(Attack2DAttributes newAttackAttributes)
 {
     ImportAttackTimingAttributes(newAttackAttributes);
     ImportAttackDamageAttributes(newAttackAttributes.attackDamageAttributes);
     ImportAttackMovementAttributes(newAttackAttributes.attackMovement);
     ImportAttackColliderAttributes(newAttackAttributes.attackColliderAttributes);
 }
Esempio n. 2
0
    private void ImportAttackTimingAttributes(Attack2DAttributes newAttackAttributes)
    {
        attackTime    = 0;
        attackEndTime = newAttackAttributes.attackLifetime;

        if (newAttackAttributes.attackCooldown > 0)
        {
            attackCooldownTime    = 0;
            attackCooldownEndTime = newAttackAttributes.attackCooldown;

            isWaitingOnAttackCooldown = true;
        }
    }
Esempio n. 3
0
    public virtual void StartAttack(Attack2D newAttack, int newAttackDirection)
    {
        currentAttack      = newAttack;
        currentAttackIndex = 0;

        currentAttackAttributes = newAttack.attackAttributes[0];

        attackDirection = newAttackDirection;

        ImportAttackAttributes(currentAttackAttributes);

        objectAnimator.SetTrigger("isAttack");
        objectAnimator.SetTrigger(newAttack.attackName);

        isActivelyAttacking = true;
        isActivelyMoving    = true;
    }
Esempio n. 4
0
    private void MoveToNextAttack()
    {
        isActivelyAttacking = false;
        isActivelyMoving    = false;

        if (CanMoveToNextAttackSection())
        {
            ClearAttackHitList();

            currentAttackAttributes = currentAttack.attackAttributes[currentAttackIndex];

            ImportAttackAttributes(currentAttackAttributes);

            isActivelyAttacking = true;
            isActivelyMoving    = true;
        }
        else
        {
            EndAttack();
        }
    }