新增 FlowScope Git 包雏形
This commit is contained in:
31
Packages/com.flowscope.gamecore/Runtime/Flow/FeatureBase.cs
Normal file
31
Packages/com.flowscope.gamecore/Runtime/Flow/FeatureBase.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FlowScope.Flow
|
||||
{
|
||||
public abstract class FeatureBase : IFeature
|
||||
{
|
||||
protected FeatureContext Context { get; private set; }
|
||||
|
||||
public virtual Task LoadAsync(FeatureContext context)
|
||||
{
|
||||
Context = context;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual Task EnterAsync(FeatureContext context)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual Task ExitAsync(FeatureContext context)
|
||||
{
|
||||
context?.Disposables.Clear();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
Context = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user