When upgrading from 2.9x to 3.0 there are a few things you need to do to make it work.
- Backup your project is always a good idea since 3.0 will not be able to read settings from 2.x
- Remove the A* scripts in the Assets/Editor folder
- Remove the Assets/Editor Default Resources folder
- Remove the Assets/Pathfinding folder
- Import the 3.0 Unity Package, DO NOT copy the files from another project directly since GUISkins and other assets might get corrupted then
- All GameObjects which had the Seeker or the AstarPath component attached to them will now show up as Missing Script. You will need to reattach the components to the GameObjects
- The syntax for path calls has changed a bit
2.9x syntax: seeker.
StartPath (fromPosition,targetPosition);
3.x syntax: seeker.
StartPath (fromPosition,targetPosition, OnPathComplete);
In 2.9x the Seeker sent completed paths using SendMessage as a Vector3 array
3.0 will send a callback using a delegate to a specified function, doesn't matter if the path succeeded or not, it will always call that function except in the case where the path was canceled by a new path call to the same Seeker before the path had time to complete
public void OnPathComplete (Path p) {
if (!p.error) {
} else {
}
}
More info about the seeker's path calls can be found on the Get Started With the A* Pathfinding Project page
- The syntax for graph updating has changed a bit, see Graph Updates during Runtime