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

@@ -21,7 +21,7 @@ public abstract class BehaviourBase : BaseEntity, IBehaviour
int previousPriority = _priority;
_priority = value;
OnPriorityChanged?.InvokeSafe(this, previousPriority);
OnPriorityChanged?.Invoke(this, previousPriority);
}
}
@@ -39,7 +39,7 @@ public abstract class BehaviourBase : BaseEntity, IBehaviour
behaviourController.OnUniverseObjectAssigned += OnUniverseObjectAssigned;
if (behaviourController.UniverseObject is not null)
OnUniverseObjectAssigned(behaviourController);
OnBehaviourControllerAssigned?.InvokeSafe(this);
OnBehaviourControllerAssigned?.Invoke(this);
return true;
}
@@ -79,6 +79,6 @@ public abstract class BehaviourBase : BaseEntity, IBehaviour
_isActive = StateEnable.Enabled && _behaviourController.UniverseObject.IsActive;
if (previousActive != IsActive)
OnActiveChanged?.InvokeSafe(this, previousActive);
OnActiveChanged?.Invoke(this, previousActive);
}
}