This commit is contained in:
CortexCore
2023-11-06 01:17:23 +08:00
parent bd40165ade
commit 5446067f91
114 changed files with 2023 additions and 414 deletions

View File

@@ -4,7 +4,7 @@ using System.ComponentModel.Design;
#if NET5_0_OR_GREATER
using Microsoft.Extensions.DependencyInjection;
#endif
namespace BITKit.Core.Entites
namespace BITKit.Entities
{
/// <summary>
/// 基本实体
@@ -17,19 +17,31 @@ namespace BITKit.Core.Entites
IEntityComponent[] Components { get; }
bool RegisterComponent<T>(T component);
IServiceProvider ServiceProvider { get; }
#if NET5_0_OR_GREATER
IServiceCollection ServiceCollection { get; }
#endif
void Inject(object obj);
}
/// <summary>
/// 基本实体组件
/// </summary>
public interface IEntityComponent:IAwake,IStart
public interface IEntityComponent
{
Type BaseType { get; }
IEntity Entity { get; set; }
#if NET5_0_OR_GREATER
void BuildService(IServiceCollection serviceCollection);
#endif
}
public interface IEntityBehavior:IEntityComponent
{
void Initialize(IEntity _entity);
void OnAwake();
void OnStart();
void OnUpdate(float deltaTime);
void OnFixedUpdate(float deltaTime);
void OnLateUpdate(float deltaTime);
void OnDestroyComponent();
}
/// <summary>
/// 基本实体服务
/// </summary>