ResourceLoader.cs 465 B

123456789101112131415161718
  1. using System.IO;
  2. using UnityEngine;
  3. namespace UnityEditor.U2D.Animation
  4. {
  5. internal static class ResourceLoader
  6. {
  7. const string k_ResourcePath = "Packages/com.unity.2d.animation/Editor/Assets";
  8. internal static T Load<T>(string path) where T : Object
  9. {
  10. var assetPath = Path.Combine(k_ResourcePath, path);
  11. var asset = AssetDatabase.LoadAssetAtPath<T>(assetPath);
  12. return asset;
  13. }
  14. }
  15. }