Fix deprecation warnings in the AStar package
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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"+
|
||||
|
||||
Reference in New Issue
Block a user