2022-11-10 13:06:37 +08:00
|
|
|
|
using SHADE;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
public abstract class BaseState
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
protected string stateName = "Base State";
|
|
|
|
|
protected StateMachine machine;
|
|
|
|
|
protected string animationName = "";
|
|
|
|
|
|
2022-11-11 14:17:47 +08:00
|
|
|
|
public BaseState(StateMachine stateMachine, string animName = "")
|
2022-11-10 13:06:37 +08:00
|
|
|
|
{
|
|
|
|
|
machine = stateMachine;
|
|
|
|
|
animationName = animName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void OnEnter()
|
2023-03-10 16:26:52 +08:00
|
|
|
|
{}
|
2022-11-10 13:06:37 +08:00
|
|
|
|
|
2022-11-13 21:56:28 +08:00
|
|
|
|
public abstract void update();
|
|
|
|
|
|
|
|
|
|
public abstract void fixedUpdate();
|
2022-11-10 13:06:37 +08:00
|
|
|
|
|
|
|
|
|
public virtual void OnExit()
|
2023-03-10 16:26:52 +08:00
|
|
|
|
{}
|
2022-11-10 13:06:37 +08:00
|
|
|
|
|
|
|
|
|
public string GetStateName()
|
|
|
|
|
{
|
|
|
|
|
return stateName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string GetAnimName()
|
|
|
|
|
{
|
|
|
|
|
return animationName;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-11 14:17:47 +08:00
|
|
|
|
public virtual void onCollisionEnter(CollisionInfo info)
|
2022-11-10 13:06:37 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-11 14:17:47 +08:00
|
|
|
|
public virtual void onCollisionStay(CollisionInfo info)
|
2022-11-10 13:06:37 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
2022-11-11 14:17:47 +08:00
|
|
|
|
|
2022-11-10 13:06:37 +08:00
|
|
|
|
public virtual void onCollisionExit(CollisionInfo info)
|
|
|
|
|
{
|
|
|
|
|
}
|
2022-11-11 14:17:47 +08:00
|
|
|
|
|
2022-11-10 13:06:37 +08:00
|
|
|
|
public virtual void onTriggerEnter(CollisionInfo info)
|
|
|
|
|
{
|
|
|
|
|
}
|
2022-11-11 14:17:47 +08:00
|
|
|
|
|
2022-11-10 13:06:37 +08:00
|
|
|
|
public virtual void onTriggerStay(CollisionInfo info)
|
|
|
|
|
{
|
|
|
|
|
}
|
2022-11-11 14:17:47 +08:00
|
|
|
|
|
2022-11-10 13:06:37 +08:00
|
|
|
|
public virtual void onTriggerExit(CollisionInfo info)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|