您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
23 行
557 B
23 行
557 B
using DeivSky.StateMachine;
|
|
using DeivSky.StateMachine.ScriptableObjects;
|
|
using UnityEngine;
|
|
|
|
[CreateAssetMenu(fileName = "Eat", menuName = "State Machines/Tests/Actions/Eat")]
|
|
public class EatActionSO : StateActionSO<EatAction> { }
|
|
|
|
public class EatAction : StateAction
|
|
{
|
|
private HungerComponent _hungerComponent;
|
|
|
|
public override void Awake(StateMachine stateMachine)
|
|
{
|
|
_hungerComponent = stateMachine.GetComponent<HungerComponent>();
|
|
}
|
|
|
|
public override void OnUpdate() { }
|
|
|
|
public override void OnStateExit()
|
|
{
|
|
_hungerComponent.Eat();
|
|
}
|
|
}
|