示例#1
0
    private void MoveMeleeWeapon(Vector3 mousePosition)
    {
        if (!currentWeaponHand.IsMelee() || !currentWeaponHand.GetWeapon().CanAttack())
        {
            return;
        }

        float attackCooldown = currentWeaponHand.GetWeapon().attackCooldown;

        MovementUtils.Instance.RotateTowardsAndBack(currentWeaponHand.GetHand().transform, mousePosition, attackCooldown * 1 / 3, attackCooldown * 2 / 3);
    }
示例#2
0
    private void AimWeapon()
    {
        Vector3    mousePosition = GetMousePosition();
        WeaponHand weaponHand    = GetUsedWeaponHand(mousePosition);

        if (weaponHand.IsMelee())
        {
            return;
        }

        if (weaponHand != currentWeaponHand)
        {
            if (currentIdleCoroutine != null)
            {
                StopCoroutine(currentIdleCoroutine);
            }
            currentIdleCoroutine = MoveToIdlePosition(GetIdleWeaponHand(mousePosition));
        }

        MovementUtils.Instance.RotateTowards(weaponHand.GetHand(), mousePosition);
        currentWeaponHand = weaponHand;
    }