A* Pathfinding Project

Seeker.pathCallback should be an event


#1

Hi,
Rider highlighted to me that using -= for pathCallback (which AIBase.OnDisable() does) gives unpredictable results.
I realised I’m using += and -= 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.)
Thx, R.


#2

Hey,

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

Wolf