Files
Darklings-FightingGame/Assets/_Project/Scripts/PlayerScripts/PlayerComboSystem.cs

54 lines
978 B
C#
Raw Normal View History

2021-08-23 00:37:37 +02:00
using UnityEngine;
public class PlayerComboSystem : MonoBehaviour
{
[SerializeField] private AttackSO _2L = default;
2021-09-08 19:54:17 +02:00
[SerializeField] private AttackSO _4L = default;
2021-08-23 00:37:37 +02:00
[SerializeField] private AttackSO _5L = default;
[SerializeField] private AttackSO _6L = default;
2021-09-06 01:46:04 +02:00
[SerializeField] private AttackSO _jumpL = default;
2021-10-26 02:33:44 +02:00
[SerializeField] private ArcanaSO _arcana = default;
2021-08-23 00:37:37 +02:00
private PlayerMovement _playerMovement;
void Awake()
{
_playerMovement = GetComponent<PlayerMovement>();
}
public AttackSO GetComboAttack()
{
2021-11-03 19:09:39 +01:00
if (_playerMovement.IsCrouching && _playerMovement.IsGrounded)
2021-08-23 00:37:37 +02:00
{
return _2L;
}
else
{
2021-09-06 01:46:04 +02:00
if (!_playerMovement.IsGrounded)
{
return _jumpL;
}
else if (_playerMovement.IsMoving)
2021-08-23 00:37:37 +02:00
{
2021-09-09 17:30:02 +02:00
if (_playerMovement.MovementInput.x * transform.localScale.x > 0.0f)
2021-09-08 19:54:17 +02:00
{
return _6L;
}
else
{
return _4L;
}
2021-08-23 00:37:37 +02:00
}
else
{
return _5L;
}
}
}
2021-09-28 17:04:18 +02:00
2021-10-26 02:33:44 +02:00
public ArcanaSO GetArcana()
2021-09-28 17:04:18 +02:00
{
2021-10-26 02:33:44 +02:00
return _arcana;
2021-09-28 17:04:18 +02:00
}
2021-08-23 00:37:37 +02:00
}