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