breakpoint
This commit is contained in:
@@ -3,8 +3,10 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using BITKit.Core.Entites;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace BITKit;
|
||||
/// <summary>
|
||||
@@ -29,11 +31,28 @@ public partial class Entity : Node,IEntity
|
||||
/// IEntity.Id实现
|
||||
/// </summary>
|
||||
public ulong Id { get; private set; }
|
||||
|
||||
public CancellationToken CancellationToken => _cancellationTokenSource.Token;
|
||||
private CancellationTokenSource _cancellationTokenSource;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 服务提供者
|
||||
/// </summary>
|
||||
public IServiceProvider ServiceProvider { get; private set; }
|
||||
private IServiceCollection _serviceCollection;
|
||||
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
_cancellationTokenSource = new CancellationTokenSource();
|
||||
}
|
||||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
_cancellationTokenSource.Cancel();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载所有EntityComponent的内部实现
|
||||
/// </summary>
|
||||
@@ -46,7 +65,6 @@ public partial class Entity : Node,IEntity
|
||||
_serviceCollection = new ServiceCollection();
|
||||
_serviceCollection.AddLogging();
|
||||
|
||||
|
||||
foreach (var x in MathNode.GetAllNode(this))
|
||||
{
|
||||
GetInstanceId();
|
||||
|
@@ -14,4 +14,5 @@ public partial class EntityComponent : Node,IEntityComponent
|
||||
public virtual void BuildService(IServiceCollection serviceCollection){}
|
||||
public virtual void OnStart(){}
|
||||
public virtual void OnAwake(){}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user