Reply To: Disabling Domain Reload – MissingReferenceException when calling agent.name

NodeCanvas Forums Support Disabling Domain Reload – MissingReferenceException when calling agent.name Reply To: Disabling Domain Reload – MissingReferenceException when calling agent.name

#17153
ledshok
Participant

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…