Not sure if you’ve had a chance to investigate this, but I think it may be related to OnDisable not always being called for my custom ConditionTask.
So in OnEnable it subscribes to an event, but if OnDisable isn’t called the event isn’t unsubscribed. On entering play mode again, I’ll see multiple subscribers to my event, only one of which will have the agent value set.
Hope that helps.
EDIT: at a basic level, am I correct in thinking that my custom ConditionTask’s OnEnable and OnDisable methods should be called an equal number of times during a single play mode session (from startup to quit)? If I stick Debug.Log statements in each I’m getting a higher count of OnEnable than OnDisable…
Login
Register
By registering on this website you agree to our Privacy Policy.