perf: DelegateExtensions.InvokeSafe marked obsolete for memory allocation reasons, soon to be removed
This commit is contained in:
@@ -61,12 +61,12 @@ public class ActiveBehaviourCollector<T> : IBehaviourCollector<T> where T : clas
|
||||
{
|
||||
activeBehaviours.Add(behaviour);
|
||||
OnBehaviourAdd(behaviour);
|
||||
OnCollected?.InvokeSafe(this, behaviour);
|
||||
OnCollected?.Invoke(this, behaviour);
|
||||
}
|
||||
else if (activeBehaviours.Remove(behaviour))
|
||||
{
|
||||
OnBehaviourRemove(behaviour);
|
||||
OnRemoved?.InvokeSafe(this, behaviour);
|
||||
OnRemoved?.Invoke(this, behaviour);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class ActiveBehaviourCollector<T> : IBehaviourCollector<T> where T : clas
|
||||
if (activeBehaviours.Remove(tBehaviour))
|
||||
{
|
||||
OnBehaviourRemove(tBehaviour);
|
||||
OnRemoved?.InvokeSafe(this, tBehaviour);
|
||||
OnRemoved?.Invoke(this, tBehaviour);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ public class ActiveBehaviourCollector<T> : IBehaviourCollector<T> where T : clas
|
||||
universe.OnUniverseObjectUnRegistered += OnUniverseObjectUnregistered;
|
||||
|
||||
Universe = universe;
|
||||
OnUniverseAssigned?.InvokeSafe(this);
|
||||
OnUniverseAssigned?.Invoke(this);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public class ActiveBehaviourCollector<T> : IBehaviourCollector<T> where T : clas
|
||||
Universe.OnUniverseObjectUnRegistered -= OnUniverseObjectUnregistered;
|
||||
|
||||
Universe = null!;
|
||||
OnUnassigned?.InvokeSafe(this);
|
||||
OnUnassigned?.Invoke(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user