ScriptableObjectCollection
ScriptableObjectCollection copied to clipboard
Fix AssetDatabase.AssetPathExists compatibility for Unity versions before 2023.1
Summary
This PR fixes a compilation error that occurs when using Unity versions prior to 2023.1 due to the use of AssetDatabase.AssetPathExists, which was added in Unity 2023.1.0a4.
Changes
- Added preprocessor directives to check Unity version
- For Unity 2023.1 and newer: Use
AssetDatabase.AssetPathExists - For older versions: Use
AssetDatabase.LoadAssetAtPath<UnityEngine.Object>() != nullas a fallback
Testing
- Verified that the functionality works correctly on both Unity 2022.3 and 2023.1+