mirror of
https://github.com/DCFApixels/DragonECS-AutoInjections.git
synced 2025-09-18 05:04:35 +08:00
refactoring
This commit is contained in:
parent
12b7bba708
commit
a7c6a5856a
@ -46,7 +46,8 @@ namespace DCFApixels.DragonECS
|
|||||||
.Where(o => o.GetCustomAttribute<EcsInjectAttribute>() != null)
|
.Where(o => o.GetCustomAttribute<EcsInjectAttribute>() != null)
|
||||||
.Select(o => new InjectedField(o)));
|
.Select(o => new InjectedField(o)));
|
||||||
result.AddRange(type.GetProperties(bindingFlags)
|
result.AddRange(type.GetProperties(bindingFlags)
|
||||||
.Where(o => {
|
.Where(o =>
|
||||||
|
{
|
||||||
if (o.GetCustomAttribute<EcsInjectAttribute>() == null)
|
if (o.GetCustomAttribute<EcsInjectAttribute>() == null)
|
||||||
return false;
|
return false;
|
||||||
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
|
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
|
||||||
@ -57,7 +58,8 @@ namespace DCFApixels.DragonECS
|
|||||||
})
|
})
|
||||||
.Select(o => new InjectedProperty(o)));
|
.Select(o => new InjectedProperty(o)));
|
||||||
result.AddRange(type.GetMethods(bindingFlags)
|
result.AddRange(type.GetMethods(bindingFlags)
|
||||||
.Where(o => {
|
.Where(o =>
|
||||||
|
{
|
||||||
if (o.GetCustomAttribute<EcsInjectAttribute>() == null)
|
if (o.GetCustomAttribute<EcsInjectAttribute>() == null)
|
||||||
return false;
|
return false;
|
||||||
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
|
#if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
|
||||||
@ -160,7 +162,7 @@ namespace DCFApixels.DragonECS
|
|||||||
public void Inject(EcsPipeline obj) => _pipeline = obj;
|
public void Inject(EcsPipeline obj) => _pipeline = obj;
|
||||||
public void PreInject(object obj)
|
public void PreInject(object obj)
|
||||||
{
|
{
|
||||||
if(!_preInitInjectCompleted)
|
if (!_preInitInjectCompleted)
|
||||||
_delayedInjects.Add(obj);
|
_delayedInjects.Add(obj);
|
||||||
else
|
else
|
||||||
_autoInjectionMap.Inject(obj.GetType(), obj);
|
_autoInjectionMap.Inject(obj.GetType(), obj);
|
||||||
|
Loading…
Reference in New Issue
Block a user