fix: remove behaviour not starting the reverse for loop from count - 1
This commit is contained in:
@@ -72,7 +72,7 @@ public class BehaviourController : BaseEntity, IBehaviourController
|
||||
|
||||
public void RemoveBehaviour<T>(bool removeAll = false) where T : class, IBehaviour
|
||||
{
|
||||
for (int i = behaviours.Count; i >= 0; i--)
|
||||
for (int i = behaviours.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (behaviours[i] is not T behaviour)
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user