You've already forked Darklings-FightingGame
mirror of
https://github.com/izzy2lost/Darklings-FightingGame.git
synced 2026-03-10 11:35:19 -07:00
54 lines
978 B
C#
54 lines
978 B
C#
using UnityEngine;
|
|
|
|
public class PlayerComboSystem : MonoBehaviour
|
|
{
|
|
[SerializeField] private AttackSO _2L = default;
|
|
[SerializeField] private AttackSO _4L = default;
|
|
[SerializeField] private AttackSO _5L = default;
|
|
[SerializeField] private AttackSO _6L = default;
|
|
[SerializeField] private AttackSO _jumpL = default;
|
|
[SerializeField] private ArcanaSO _arcana = default;
|
|
private PlayerMovement _playerMovement;
|
|
|
|
|
|
void Awake()
|
|
{
|
|
_playerMovement = GetComponent<PlayerMovement>();
|
|
}
|
|
|
|
public AttackSO GetComboAttack()
|
|
{
|
|
if (_playerMovement.IsCrouching && _playerMovement.IsGrounded)
|
|
{
|
|
return _2L;
|
|
}
|
|
else
|
|
{
|
|
if (!_playerMovement.IsGrounded)
|
|
{
|
|
return _jumpL;
|
|
}
|
|
else if (_playerMovement.IsMoving)
|
|
{
|
|
if (_playerMovement.MovementInput.x * transform.localScale.x > 0.0f)
|
|
{
|
|
return _6L;
|
|
}
|
|
else
|
|
{
|
|
return _4L;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return _5L;
|
|
}
|
|
}
|
|
}
|
|
|
|
public ArcanaSO GetArcana()
|
|
{
|
|
return _arcana;
|
|
}
|
|
}
|