2021-08-23 00:37:37 +02:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class PlayerComboSystem : MonoBehaviour
|
|
|
|
|
{
|
2021-12-11 18:37:11 +01:00
|
|
|
private PlayerStats _playerStats;
|
2021-08-23 00:37:37 +02:00
|
|
|
private PlayerMovement _playerMovement;
|
|
|
|
|
|
|
|
|
|
void Awake()
|
|
|
|
|
{
|
|
|
|
|
_playerMovement = GetComponent<PlayerMovement>();
|
2021-12-11 18:37:11 +01:00
|
|
|
_playerStats = GetComponent<PlayerStats>();
|
2021-08-23 00:37:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public AttackSO GetComboAttack()
|
|
|
|
|
{
|
2021-11-03 19:09:39 +01:00
|
|
|
if (_playerMovement.IsCrouching && _playerMovement.IsGrounded)
|
2021-08-23 00:37:37 +02:00
|
|
|
{
|
2021-12-11 18:37:11 +01:00
|
|
|
return _playerStats.PlayerStatsSO.m2L;
|
2021-08-23 00:37:37 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2021-09-06 01:46:04 +02:00
|
|
|
if (!_playerMovement.IsGrounded)
|
|
|
|
|
{
|
2021-12-11 18:37:11 +01:00
|
|
|
return _playerStats.PlayerStatsSO.jumpL;
|
2021-09-06 01:46:04 +02:00
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2021-12-11 18:37:11 +01:00
|
|
|
return _playerStats.PlayerStatsSO.m6L;
|
2021-09-08 19:54:17 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2021-12-11 18:37:11 +01:00
|
|
|
return _playerStats.PlayerStatsSO.m4L;
|
2021-09-08 19:54:17 +02:00
|
|
|
}
|
2021-08-23 00:37:37 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2021-12-11 18:37:11 +01:00
|
|
|
return _playerStats.PlayerStatsSO.m5L;
|
2021-08-23 00:37:37 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
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-12-11 18:37:11 +01:00
|
|
|
return _playerStats.PlayerStatsSO.arcana;
|
2021-09-28 17:04:18 +02:00
|
|
|
}
|
2021-08-23 00:37:37 +02:00
|
|
|
}
|