From 8f5a88e1f5900bb745ab5d6db4bceb58535dc81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=80=9D=E6=B5=B7?= <1464576565@qq.com> Date: Mon, 29 Sep 2025 15:07:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/FSM/SimpleFSM.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Runtime/FSM/SimpleFSM.cs b/Runtime/FSM/SimpleFSM.cs index 5e0dd12..182ea45 100644 --- a/Runtime/FSM/SimpleFSM.cs +++ b/Runtime/FSM/SimpleFSM.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; using AlicizaX; -public interface IState : IMemory +public interface IState { IUltraFSM Fsm { get; set; } bool IsRegistered { get; set; } @@ -16,13 +16,6 @@ public interface IState : IMemory public abstract class StateBase : IState where TState : Enum { - public void Clear() - { - IsRegistered = false; - Fsm = null; - } - - public bool fromPool { get; set; } public IUltraFSM Fsm { get; set; } public bool IsRegistered { get; set; } @@ -160,7 +153,7 @@ public sealed class SimpleFSM : IUltraFSM where TState : Enum } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Register(TState stateId) where T : class, IMemory, IState, new() + public void Register(TState stateId) where T : class, IState, new() { int stateIdValue = Convert.ToInt32(stateId); if (stateIdValue < 0) @@ -174,7 +167,6 @@ public sealed class SimpleFSM : IUltraFSM where TState : Enum if (existingState != null && existingState.IsRegistered) { existingState.Destroy(); - MemoryPool.Release(existingState); _registeredCount--; }