perf: DelegateExtensions.InvokeSafe marked obsolete for memory allocation reasons, soon to be removed
This commit is contained in:
@@ -27,7 +27,7 @@ public class BehaviourController : BaseEntity, IBehaviourController
|
||||
if (IsInitialized)
|
||||
behaviour.Initialize();
|
||||
behaviour.OnPriorityChanged += OnPriorityChange;
|
||||
OnBehaviourAdded?.InvokeSafe(this, behaviour);
|
||||
OnBehaviourAdded?.Invoke(this, behaviour);
|
||||
return behaviour;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class BehaviourController : BaseEntity, IBehaviourController
|
||||
behaviour.OnPriorityChanged -= OnPriorityChange;
|
||||
behaviour.Finalize();
|
||||
behaviours.Remove(behaviour);
|
||||
OnBehaviourRemoved?.InvokeSafe(this, behaviour);
|
||||
OnBehaviourRemoved?.Invoke(this, behaviour);
|
||||
}
|
||||
|
||||
protected virtual void OnAssign(IUniverseObject universeObject) { }
|
||||
@@ -106,7 +106,7 @@ public class BehaviourController : BaseEntity, IBehaviourController
|
||||
|
||||
_universeObject = universeObject;
|
||||
OnAssign(universeObject);
|
||||
OnUniverseObjectAssigned?.InvokeSafe(this);
|
||||
OnUniverseObjectAssigned?.Invoke(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user