PXR_PlatformSetting.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*******************************************************************************
  2. Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
  3. NOTICE:All information contained herein is, and remains the property of
  4. PICO Technology Co., Ltd. The intellectual and technical concepts
  5. contained herein are proprietary to PICO Technology Co., Ltd. and may be
  6. covered by patents, patents in process, and are protected by trade secret or
  7. copyright law. Dissemination of this information or reproduction of this
  8. material is strictly forbidden unless prior written permission is obtained from
  9. PICO Technology Co., Ltd.
  10. *******************************************************************************/
  11. using System.Collections.Generic;
  12. using System.IO;
  13. using UnityEditor;
  14. using UnityEngine;
  15. namespace Unity.XR.PXR
  16. {
  17. #if UNITY_EDITOR
  18. [InitializeOnLoad]
  19. #endif
  20. public sealed class PXR_PlatformSetting : ScriptableObject
  21. {
  22. public enum simulationType
  23. {
  24. Null,
  25. Invalid,
  26. Valid
  27. }
  28. [SerializeField] public bool entitlementCheckSimulation;
  29. [SerializeField] public bool startTimeEntitlementCheck;
  30. [SerializeField] public string appID;
  31. [SerializeField] public bool useHighlight = true;
  32. public List<string> deviceSN = new List<string>();
  33. private static PXR_PlatformSetting instance;
  34. public static PXR_PlatformSetting Instance
  35. {
  36. get
  37. {
  38. if (instance == null)
  39. {
  40. instance = Resources.Load<PXR_PlatformSetting>("PXR_PlatformSetting");
  41. #if UNITY_EDITOR
  42. string path = Application.dataPath + "/Resources";
  43. if (!Directory.Exists(path))
  44. {
  45. AssetDatabase.CreateFolder("Assets", "Resources");
  46. if (instance == null)
  47. {
  48. instance = CreateInstance<PXR_PlatformSetting>();
  49. AssetDatabase.CreateAsset(instance, "Assets/Resources/PXR_PlatformSetting.asset");
  50. }
  51. }
  52. else
  53. {
  54. if (instance == null)
  55. {
  56. instance = CreateInstance<PXR_PlatformSetting>();
  57. AssetDatabase.CreateAsset(instance, "Assets/Resources/PXR_PlatformSetting.asset");
  58. }
  59. }
  60. #endif
  61. }
  62. return instance;
  63. }
  64. set { instance = value; }
  65. }
  66. }
  67. }
粤ICP备19079148号