MonoSingleton.cs 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. #region 程序集 SDK, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
  2. // G:\GUnityProject\MREdustryXR\Library\ScriptAssemblies\SDK.dll
  3. // Decompiled with ICSharpCode.Decompiler 6.1.0.5902
  4. #endregion
  5. using UnityEngine;
  6. public abstract class MonoSingleton<T> : MonoBehaviour where T : MonoBehaviour
  7. {
  8. public bool global = true;
  9. private static T instance;
  10. protected bool _isInit;
  11. public static T Instance
  12. {
  13. get
  14. {
  15. if ((Object)instance == (Object)null)
  16. {
  17. instance = Object.FindObjectOfType<T>();
  18. }
  19. return instance;
  20. }
  21. }
  22. private void Start()
  23. {
  24. if (global)
  25. {
  26. Object.DontDestroyOnLoad(base.gameObject);
  27. }
  28. OnStart();
  29. }
  30. protected virtual void OnStart()
  31. {
  32. }
  33. }
  34. #if false // 反编译日志
  35. 缓存中的 320 项
  36. ------------------
  37. 解析: "netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"
  38. 找到单个程序集: "netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"
  39. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\NetStandard\ref\2.1.0\netstandard.dll"
  40. ------------------
  41. 解析: "UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  42. 找到单个程序集: "UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  43. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll"
  44. ------------------
  45. 解析: "UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
  46. 找到单个程序集: "UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
  47. 从以下位置加载: "G:\GUnityProject\MREdustryXR\Library\ScriptAssemblies\UnityEngine.UI.dll"
  48. ------------------
  49. 解析: "UnityEngine.TextRenderingModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  50. 找到单个程序集: "UnityEngine.TextRenderingModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  51. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.TextRenderingModule.dll"
  52. ------------------
  53. 解析: "Unity.TextMeshPro, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  54. 找到单个程序集: "Unity.TextMeshPro, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  55. 从以下位置加载: "G:\GUnityProject\MREdustryXR\Library\ScriptAssemblies\Unity.TextMeshPro.dll"
  56. ------------------
  57. 解析: "UnityEngine.InputLegacyModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  58. 找到单个程序集: "UnityEngine.InputLegacyModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  59. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.InputLegacyModule.dll"
  60. ------------------
  61. 解析: "UnityEngine.AudioModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  62. 找到单个程序集: "UnityEngine.AudioModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  63. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.AudioModule.dll"
  64. ------------------
  65. 解析: "UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  66. 找到单个程序集: "UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  67. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.PhysicsModule.dll"
  68. ------------------
  69. 解析: "DOTween, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
  70. 找到单个程序集: "DOTween, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
  71. 从以下位置加载: "G:\GUnityProject\MREdustryXR\Library\PackageCache\com.ximmerse.xr@6b1955bc52\Assets\Demigiant\DOTween\DOTween.dll"
  72. ------------------
  73. 解析: "UnityEngine.VideoModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  74. 找到单个程序集: "UnityEngine.VideoModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  75. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.VideoModule.dll"
  76. ------------------
  77. 解析: "LitJson, Version=0.9.0.0, Culture=neutral, PublicKeyToken=null"
  78. 找到单个程序集: "LitJson, Version=0.9.0.0, Culture=neutral, PublicKeyToken=null"
  79. 从以下位置加载: "G:\GUnityProject\MREdustryXR\Library\PackageCache\com.ximmerse.xr@6b1955bc52\Runtime\LitJson.dll"
  80. ------------------
  81. 解析: "UnityEngine.UnityWebRequestModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  82. 找到单个程序集: "UnityEngine.UnityWebRequestModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  83. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestModule.dll"
  84. ------------------
  85. 解析: "UnityEngine.AndroidJNIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  86. 找到单个程序集: "UnityEngine.AndroidJNIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  87. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.AndroidJNIModule.dll"
  88. ------------------
  89. 解析: "UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  90. 找到单个程序集: "UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  91. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.AnimationModule.dll"
  92. ------------------
  93. 解析: "UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  94. 找到单个程序集: "UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  95. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.UIModule.dll"
  96. ------------------
  97. 解析: "UnityEngine.IMGUIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  98. 找到单个程序集: "UnityEngine.IMGUIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  99. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.IMGUIModule.dll"
  100. ------------------
  101. 解析: "Unity.InputSystem, Version=1.4.4.0, Culture=neutral, PublicKeyToken=null"
  102. 找到单个程序集: "Unity.InputSystem, Version=1.4.4.0, Culture=neutral, PublicKeyToken=null"
  103. 从以下位置加载: "G:\GUnityProject\MREdustryXR\Library\ScriptAssemblies\Unity.InputSystem.dll"
  104. ------------------
  105. 解析: "UnityEngine.XRModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  106. 找到单个程序集: "UnityEngine.XRModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  107. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.XRModule.dll"
  108. ------------------
  109. 解析: "UnityEngine.DirectorModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  110. 找到单个程序集: "UnityEngine.DirectorModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  111. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.DirectorModule.dll"
  112. ------------------
  113. 解析: "UnityEditor.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  114. 找到单个程序集: "UnityEditor.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  115. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEditor.CoreModule.dll"
  116. ------------------
  117. 解析: "UnityEngine.ParticleSystemModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  118. 找到单个程序集: "UnityEngine.ParticleSystemModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  119. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.ParticleSystemModule.dll"
  120. ------------------
  121. 解析: "UnityEngine.AIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  122. 找到单个程序集: "UnityEngine.AIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  123. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.AIModule.dll"
  124. ------------------
  125. 解析: "UnityEngine.JSONSerializeModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  126. 找到单个程序集: "UnityEngine.JSONSerializeModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  127. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.JSONSerializeModule.dll"
  128. ------------------
  129. 解析: "UnityEngine.VRModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  130. 找到单个程序集: "UnityEngine.VRModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  131. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.VRModule.dll"
  132. ------------------
  133. 解析: "DOTween46, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
  134. 找到单个程序集: "DOTween46, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
  135. 从以下位置加载: "G:\GUnityProject\MREdustryXR\Library\PackageCache\com.ximmerse.xr@6b1955bc52\Assets\Demigiant\DOTween\DOTween46.dll"
  136. ------------------
  137. 解析: "UnityEngine.ImageConversionModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  138. 找到单个程序集: "UnityEngine.ImageConversionModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  139. 从以下位置加载: "E:\Unity\2021.3.16f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.ImageConversionModule.dll"
  140. #endif