So the Path.Claim(someObject) method, what should actually be passed in? in most examples it is this which is a monobehaviour, but if you are running your code in some class outside of the scope of an MB does it just need to a gameobject or something?
The API doesn’t really provide much information on what it should be other than an object.
The object passed to this method is merely used as a way to more easily detect when pooling is not done correctly.
It can be any object, when used from a movement script you can just pass “this”. This class will throw an exception
if you try to call Claim on a path twice with the same object (which is usually not what you want) or
if you try to call Release with an object that has not been used in a Claim call.
The object passed to the Claim method needs to be the same as the one you pass to this method.
I have updated the docs in my dev version now to explain how it is used (same text as above).
So just to confirm, the object is just a key to be used to identify where the path was claimed from, so if I were to claim a path on an object then make another path and try to claim it using the same object (even though its a unique path) it would throw an exception as an object can only have 1 path claimed (Regardless of the paths content)?
You can claim multiple paths using the same object, however if you try to release a path using an object which has not been used to claim it, you will get an exception. Same if you try to call Claim on the same path with the same object multiple times (without calling release in between).