코드 리팩토링
재사용성 및 확장성을 고려하여 코드 전반을 리팩토링함
This commit is contained in:
20
Assets/Scripts/Player/BehaviorActionData.cs
Normal file
20
Assets/Scripts/Player/BehaviorActionData.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Bridge class that wraps ItemBehavior for use with PlayerActionHandler.
|
||||
/// This allows the new behavior system to work with the existing action handler.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "Actions/Behavior Action")]
|
||||
public class BehaviorActionData : PlayerActionData
|
||||
{
|
||||
[HideInInspector]
|
||||
public ItemBehavior behavior;
|
||||
|
||||
public override void ExecuteEffect(GameObject performer, GameObject target)
|
||||
{
|
||||
if (behavior != null)
|
||||
{
|
||||
behavior.Use(performer, target);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user