Skip to content

Commit 42224b6

Browse files
committed
Remove usage of obsolete FindObjectsSortMode for 6.4+
1 parent b0bd17c commit 42224b6

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

com.unity.formats.alembic/Runtime/Scripts/Analytics/AlembicExporterAnalytics.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ static IEnumerable<T> GetTargets<T>(this AlembicRecorderSettings settings) where
4343
{
4444
return settings.TargetBranch != null ? settings.TargetBranch.GetComponentsInChildren<T>() : Enumerable.Empty<T>();
4545
}
46-
#if UNITY_2023_1_OR_NEWER
46+
#if UNITY_6000_4_OR_NEWER
47+
return Object.FindObjectsByType<T>();
48+
#elif UNITY_2023_1_OR_NEWER
4749
return Object.FindObjectsByType<T>(FindObjectsSortMode.InstanceID);
4850
#else
4951
return Object.FindObjectsOfType<T>();

com.unity.formats.alembic/Runtime/Scripts/Exporter/AlembicExporter_impl.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,9 @@ Component[] GetTargets(Type type)
953953
if (m_settings.Scope == ExportScope.TargetBranch && TargetBranch != null)
954954
return TargetBranch.GetComponentsInChildren(type);
955955
else
956-
#if UNITY_2023_1_OR_NEWER
956+
#if UNITY_6000_4_OR_NEWER
957+
return Array.ConvertAll<UnityEngine.Object, Component>(GameObject.FindObjectsByType(type), e => (Component)e);
958+
#elif UNITY_2023_1_OR_NEWER
957959
return Array.ConvertAll<UnityEngine.Object, Component>(GameObject.FindObjectsByType(type, FindObjectsSortMode.InstanceID), e => (Component)e);
958960
#else
959961
return Array.ConvertAll<UnityEngine.Object, Component>(GameObject.FindObjectsOfType(type), e => (Component)e);

0 commit comments

Comments
 (0)