Updated to Unity6.33f1 and imported updated AStarPath package

This commit is contained in:
MarcUs7i 2025-01-11 12:26:43 +01:00
parent 46ae47a9f0
commit ceba0343d3
35 changed files with 9662 additions and 1604 deletions

View file

@ -29,7 +29,12 @@ namespace Pathfinding {
cam = Camera.main;
// Slightly inefficient way of finding all AIs, but this is just an example script, so it doesn't matter much.
// FindObjectsOfType does not support interfaces unfortunately.
ais = FindObjectsOfType<MonoBehaviour>().OfType<IAstarAI>().ToArray();
// Changed FindObjectsOfType to FindObjectsByType
// Use the new FindObjectsByType method to find all MonoBehaviours
// Then filter them by the IAstarAI interface
ais = FindObjectsByType<MonoBehaviour>(FindObjectsSortMode.None)
.OfType<IAstarAI>()
.ToArray();
useGUILayout = false;
}