mirror of
https://github.com/Kizuren/ShantiManti.git
synced 2025-12-24 00:03:49 +01:00
Manually Upgraded Astarpath to new API
This commit is contained in:
parent
f0f1f48619
commit
ecdb3826c1
8 changed files with 15 additions and 10 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue