mirror of
https://github.com/DCFApixels/DragonECS-AutoInjections.git
synced 2025-09-17 12:24:34 +08:00
fix
This commit is contained in:
parent
69075891af
commit
6ab2c8321a
@ -101,10 +101,7 @@ namespace DCFApixels.DragonECS
|
||||
private Type[] _relatedTypesBuffer;
|
||||
public void Inject(Type fieldType, object obj)
|
||||
{
|
||||
if (_isPreInitInjectionComplete == false)
|
||||
{
|
||||
_notInjected.Remove(fieldType);
|
||||
}
|
||||
|
||||
if (_relatedTypesBuffer == null || _relatedTypesBuffer.Length < _injectedTypeToPropertiesMap.Count)
|
||||
{
|
||||
_relatedTypesBuffer = new Type[_injectedTypeToPropertiesMap.Count];
|
||||
@ -132,6 +129,10 @@ namespace DCFApixels.DragonECS
|
||||
string propertyName = item.Attribute.NamedInjection;
|
||||
if (string.IsNullOrEmpty(propertyName) || propertyName == name)
|
||||
{
|
||||
if (_isPreInitInjectionComplete == false)
|
||||
{
|
||||
_notInjected.Remove(item.property.PropertyType);
|
||||
}
|
||||
item.property.Inject(item.target, obj);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user