private void ImportAttackAttributes(Attack2DAttributes newAttackAttributes) { ImportAttackTimingAttributes(newAttackAttributes); ImportAttackDamageAttributes(newAttackAttributes.attackDamageAttributes); ImportAttackMovementAttributes(newAttackAttributes.attackMovement); ImportAttackColliderAttributes(newAttackAttributes.attackColliderAttributes); }
private void ImportAttackTimingAttributes(Attack2DAttributes newAttackAttributes) { attackTime = 0; attackEndTime = newAttackAttributes.attackLifetime; if (newAttackAttributes.attackCooldown > 0) { attackCooldownTime = 0; attackCooldownEndTime = newAttackAttributes.attackCooldown; isWaitingOnAttackCooldown = true; } }
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; }
private void MoveToNextAttack() { isActivelyAttacking = false; isActivelyMoving = false; if (CanMoveToNextAttackSection()) { ClearAttackHitList(); currentAttackAttributes = currentAttack.attackAttributes[currentAttackIndex]; ImportAttackAttributes(currentAttackAttributes); isActivelyAttacking = true; isActivelyMoving = true; } else { EndAttack(); } }