chore: initial commit
This commit is contained in:
23
Assets/Scripts/Core/IGameState.cs
Normal file
23
Assets/Scripts/Core/IGameState.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Collections.Generic;
|
||||
using BaseGames.Core.Events;
|
||||
|
||||
namespace BaseGames.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 可插件化的游戏状态行为接口。
|
||||
/// </summary>
|
||||
public interface IGameState
|
||||
{
|
||||
GameStateId Id { get; }
|
||||
|
||||
/// <summary>合法的后继状态集合。GameStateMachine.TransitionTo() 据此校验。</summary>
|
||||
IReadOnlyCollection<GameStateId> ValidNextStates { get; }
|
||||
|
||||
void OnEnter(GameStateId previousState);
|
||||
void OnExit(GameStateId nextState);
|
||||
|
||||
/// <summary>每帧由 GameManager.Update() 调用(默认空实现)。</summary>
|
||||
void Tick(float deltaTime);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user