AppHelpPackagePaths.cs 579 B

12345678910111213
  1. using System;
  2. using System.IO;
  3. using UnityEditor.PackageManager;
  4. internal static class AppHelpPackagePaths
  5. {
  6. private static PackageInfo Package => PackageInfo.FindForAssembly(typeof(AppSettings).Assembly)
  7. ?? throw new InvalidOperationException("AppRuntimes must be installed through Package Manager.");
  8. internal static string Name => Package.name;
  9. internal static string FullPath(string relativePath) => Path.Combine(Package.resolvedPath, relativePath);
  10. internal static string AssetPath(string relativePath) => Package.assetPath + "/" + relativePath;
  11. }