40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace BlueWaterProject
|
|
{
|
|
public class CombatPlayer : MonoBehaviour
|
|
{
|
|
[Required, SerializeField] private CombatInput input;
|
|
[Required, SerializeField] private CombatMovement movement;
|
|
[Required, SerializeField] private CombatAnimator animator;
|
|
|
|
private void Awake()
|
|
{
|
|
movement.combatAnimator = animator;
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
input.OnMoveInputReceived += movement.InputMovementValue;
|
|
input.OnDashInputReceived += movement.HandleDash;
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
input.OnMoveInputReceived -= movement.InputMovementValue;
|
|
input.OnDashInputReceived -= movement.HandleDash;
|
|
}
|
|
|
|
[Button("셋팅 초기화")]
|
|
private void InitSetting()
|
|
{
|
|
input = GetComponent<CombatInput>();
|
|
movement = GetComponent<CombatMovement>();
|
|
animator = GetComponent<CombatAnimator>();
|
|
}
|
|
}
|
|
}
|
|
|