Fix deprecation warnings in the AStar package

This commit is contained in:
Michal Pikulski
2025-09-03 09:39:52 +02:00
parent bba04ef885
commit d8f792c8e5
3 changed files with 5 additions and 5 deletions

View File

@@ -113,7 +113,7 @@ namespace Pathfinding {
mono.TryGetComponent<Rigidbody>(out Rigidbody rigid);
mono.TryGetComponent<Rigidbody2D>(out Rigidbody2D rigid2D);
mono.TryGetComponent<CharacterController>(out CharacterController controller);
var canUseGravity = (controller != null && controller.enabled) || ((rigid == null || rigid.isKinematic) && (rigid2D == null || rigid2D.isKinematic));
var canUseGravity = (controller != null && controller.enabled) || ((rigid == null || rigid.isKinematic) && (rigid2D == null || rigid2D.bodyType == RigidbodyType2D.Kinematic));
var gravity = FindProperty("gravity");
var groundMask = FindProperty("groundMask");

View File

@@ -948,7 +948,7 @@ namespace Pathfinding {
/// <summary>Opens the A* Inspector and shows the section for editing tags</summary>
public static void EditTags () {
AstarPath astar = GameObject.FindObjectOfType<AstarPath>();
AstarPath astar = GameObject.FindFirstObjectByType<AstarPath>();
if (astar != null) {
editTags = true;
@@ -1365,7 +1365,7 @@ namespace Pathfinding {
[MenuItem("Edit/Pathfinding/Scan All Graphs %&s")]
public static void MenuScan () {
if (AstarPath.active == null) {
AstarPath.active = FindObjectOfType<AstarPath>();
AstarPath.active = FindFirstObjectByType<AstarPath>();
if (AstarPath.active == null) {
return;
}

View File

@@ -189,7 +189,7 @@ namespace Pathfinding {
}
static void DownloadVersionInfo () {
var script = AstarPath.active != null ? AstarPath.active : GameObject.FindObjectOfType(typeof(AstarPath)) as AstarPath;
var script = AstarPath.active != null ? AstarPath.active : GameObject.FindFirstObjectByType(typeof(AstarPath)) as AstarPath;
if (script != null) {
script.ConfigureReferencesInternal();
@@ -198,7 +198,7 @@ namespace Pathfinding {
}
}
bool mecanim = GameObject.FindObjectOfType(typeof(Animator)) != null;
bool mecanim = GameObject.FindFirstObjectByType(typeof(Animator)) != null;
string query = updateURL+
"?v="+AstarPath.Version+
"&pro=0"+