chore: initial commit

This commit is contained in:
2026-05-08 11:04:00 +08:00
commit f55d2a57c3
6278 changed files with 866081 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using Animancer;
using BaseGames.Input;
using BaseGames.Player;
namespace BaseGames.Player.States
{
/// <summary>
/// 所有玩家状态的抽象基类。持有 PlayerController 引用并提供便捷属性访问。
/// 状态不继承 MonoBehaviour生命周期由 PlayerController 驱动。
/// </summary>
public abstract class PlayerStateBase
{
protected PlayerController _owner;
protected PlayerStateBase(PlayerController owner) => _owner = owner;
public virtual void OnStateEnter() { }
public virtual void OnStateUpdate() { }
public virtual void OnStateFixedUpdate() { }
public virtual void OnStateExit() { }
// ── 便捷属性 ──────────────────────────────────────────────────────────
protected PlayerController Owner => _owner;
protected InputReaderSO Input => _owner.Input;
protected InputBuffer Buffer => _owner.Buffer;
protected PlayerMovement Move => _owner.Movement;
protected PlayerStats Stats => _owner.Stats;
protected AnimancerComponent Anim => _owner.Animancer;
protected PlayerMovementConfigSO Cfg => _owner.MovConfig;
protected PlayerAnimationConfigSO AnimCfg => _owner.AnimConfig;
}
}