perf: DelegateExtensions.InvokeSafe marked obsolete for memory allocation reasons, soon to be removed

This commit is contained in:
2025-05-29 21:48:08 +03:00
parent 1b0f25e854
commit bf8fbebae3
35 changed files with 116 additions and 115 deletions

View File

@@ -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;
}