mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2025-12-16 14:11:19 +07:00
fix Unity deprecation warnings
This commit is contained in:
@@ -15,6 +15,28 @@ using FTRuntime;
|
||||
namespace FTEditor {
|
||||
static class SwfEditorUtils {
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// Compatibility
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
public static T FindObjectOfType<T>() where T : Object {
|
||||
#if UNITY_2021_3_OR_NEWER
|
||||
return Object.FindAnyObjectByType<T>();
|
||||
#else
|
||||
return Object.FindObjectOfType<T>();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static T[] FindObjectsOfType<T>() where T : Object {
|
||||
#if UNITY_2021_3_OR_NEWER
|
||||
return Object.FindObjectsByType<T>(FindObjectsSortMode.None);
|
||||
#else
|
||||
return Object.FindObjectsOfType<T>();
|
||||
#endif
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// Packing
|
||||
|
||||
Reference in New Issue
Block a user