Skip to content

Commit ea9c73b

Browse files
authored
Fix warnings due to changes on Unity 6.4+ (#655)
* Fix warnings due to changes on Unity 6.5 * Update Changelog * Address PR comments * Update Changelog
1 parent 0ece037 commit ea9c73b

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
### Fixed
1111

1212
- [UUM-133861] Fixed "Look rotation viewing vector is zero" log being spammed when holding shift while using a create tool such as Create Sprite.
13+
- Fixed warnings related to obsolete API calls with Unity 6.4 and onwards.
1314

1415
## [6.0.9] - 2026-01-30
1516

Editor/EditorCore/EditorUtility.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,11 @@ public static void SetGizmoIconEnabled(Type script, bool enabled)
453453

454454
internal static T[] FindObjectsByType<T>() where T : UObject
455455
{
456+
#if UNITY_6000_4_OR_NEWER
457+
return UObject.FindObjectsByType<T>();
458+
#else
456459
return UObject.FindObjectsByType<T>(FindObjectsSortMode.None);
460+
#endif
457461
}
458462

459463
internal static string GetActiveSceneAssetsPath()

Tests/Editor/Editor/MeshSyncTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static ulong GetRawId(Object obj)
4949
var id = obj.GetObjectId();
5050

5151
#if UNITY_6000_4_OR_NEWER
52-
return id.GetRawData();
52+
return EntityId.ToULong(id);
5353
#else
5454
return (ulong)id;
5555
#endif

Tests/Editor/Undo/TestUndo.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,19 @@ public static void CreateShape_UndoDoesRemoveTheGameObject()
5353

5454
instance.PerformAction();
5555

56+
#if UNITY_6000_4_OR_NEWER
57+
var shapes = GameObject.FindObjectsByType<ProBuilderMesh>();
58+
#else
5659
var shapes = GameObject.FindObjectsByType<ProBuilderMesh>(FindObjectsSortMode.None);
60+
#endif
5761
Assume.That(shapes.Length, Is.EqualTo(1));
5862

5963
Undo.PerformUndo();
60-
64+
#if UNITY_6000_4_OR_NEWER
65+
shapes = GameObject.FindObjectsByType<ProBuilderMesh>();
66+
#else
6167
shapes = GameObject.FindObjectsByType<ProBuilderMesh>(FindObjectsSortMode.None);
68+
#endif
6269
Assert.That(shapes.Length, Is.EqualTo(0));
6370
}
6471

0 commit comments

Comments
 (0)