Rider highlighted to me that using
AIBase.OnDisable() does) gives unpredictable results.
I realised I’m using
-= on it too so this might be causing something of a mess!
(forgive me if this has already been changed – I’m a couple of versions behind.)
Fellow Rider user here, you can pretty much ignore all warnings about delegates. There is no real way to detect how they are being used etc.
Generally rule of thumb for delegates is:
- Check if the delegate is not null
- If you’re trying to add something to a delegate, remove it first (make sure you don’t subscribe twice)
- add or remove an action from the delegate