Constant.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.IO;
  5. namespace YLSJ
  6. {
  7. /// <summary>
  8. /// 常量定义
  9. /// </summary>
  10. public class Constant
  11. {
  12. /// <summary>
  13. /// AssetBundle后缀
  14. /// </summary>
  15. public const string AssetBundleURE = ".unity3d";
  16. /// <summary>
  17. /// 符号集名称
  18. /// </summary>
  19. public const string AssemblyName = "Core";
  20. /// <summary>
  21. /// 符号集入口
  22. /// </summary>
  23. public const string AssemblyEntry = "Main";
  24. /// <summary>
  25. /// 符号集文件完整路径
  26. /// </summary>
  27. public static string AssemblyFilePath
  28. {
  29. get
  30. {
  31. string persistentDataPath = Application.persistentDataPath + "/Res/" + AssemblyName + AssetBundleURE;
  32. if (Application.isEditor)
  33. {
  34. if (File.Exists(persistentDataPath))
  35. {
  36. return persistentDataPath;
  37. }
  38. return Application.streamingAssetsPath + "/Res/" + AssemblyName + AssetBundleURE;
  39. }
  40. // 非编辑器模式下,查找沙盒即可
  41. return Application.persistentDataPath + "/Res/" + AssemblyName + AssetBundleURE;
  42. }
  43. }
  44. }
  45. }