示例#1
0
    private void DoAttack()
    {
        currentAttackGrade = BeatManager.GetGrade();
        SetupVFX();
        OnAttack?.Invoke(currentAttackGrade);
        if (currentAttackGrade != RhythmGrade.Miss)
        {
            SyncPowerManager.KeepTheBeatGoing();
        }
        else
        {
            SyncPowerManager.Miss();
        }

        player.OnAttackedPressed?.Invoke();
        PlayerAnimator.SetTrigger(CurrentAttack.AttackTag);
        RuntimeManager.PlayOneShotAttached(CurrentAttack.AttackSFX, player.gameObject);
        timer = 0;
        hitObjects.Clear();
        timeOfLastAttack = Time.time + CurrentAttack.Clip.length;

        if (DirectionInput.magnitude > 0)
        {
            PlayerAnimator.transform.LookAt(PlayerAnimator.transform.position + Vector3.ProjectOnPlane(GetInputRelativeToCamera(), Vector3.up));
        }
        AutoTargeting();
    }
示例#2
0
    public override void Enter()
    {
        if (!isOffColldown())
        {
            TransitionTo <PlayerIdleState>();
            return;
        }

        if (BeatManager.GetGrade() != RhythmGrade.Miss)
        {
            SyncPowerManager.KeepTheBeatGoing();
        }

        StreakCounterUI.DashTimerReset();
        RuntimeManager.PlayOneShot(DashSFX);
        normalDash = false;
        timer      = 0;
        hitObjects.Clear();
        ogInput = GetInputRelativeToCamera();
        Debug.Log(ogInput);
        if (ogInput.magnitude <= 0.01f)
        {
            ogInput = PlayerAnimator.transform.forward;
            Debug.Log("Small man");
        }
        ogInput = ogInput.normalized;

        PlayerAnimator.SetBool("inDash", true);

        for (int i = numDashes - 1; i >= 0; i--)
        {
            if (cooldowns[i] > dashCD)
            {
                normalDash   = true;
                cooldowns[i] = 0f;
                break;
            }
        }

        OnDash?.Invoke();
        dashVFX.enabled = true;
        dashChargeVFX.Play();
    }