com.typhoon.unitysdk 1.1.13 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,7 +1,13 @@
1
1
  # 更新日志
2
+ ## [1.1.14] - 2025-08-09
3
+
4
+ ### 修复
5
+ * 修复sdktestunity构建时间不对时的bug
6
+
7
+
2
8
  ## [1.1.13] - 2025-08-08
3
9
 
4
- ### 新增
10
+ ### 新增
5
11
  * 调整喜中游打包配置
6
12
 
7
13
 
@@ -89,32 +89,80 @@ public class SdkTestInUnity : ScriptableObject
89
89
  };
90
90
 
91
91
 
92
+ // private static SdkTestInUnity _instance = null;
93
+ //
94
+ // public static SdkTestInUnity Instance
95
+ // {
96
+ // get
97
+ // {
98
+ // #if UNITY_EDITOR
99
+ // if (_instance == null)
100
+ // {
101
+ // _instance = AssetDatabase.LoadAssetAtPath<SdkTestInUnity>(ASSET_PATH);
102
+ // if (_instance == null)
103
+ // {
104
+ // _instance = CreateInstance<SdkTestInUnity>();
105
+ // var folder = Path.GetDirectoryName(ASSET_PATH);
106
+ // if (!Directory.Exists(folder))
107
+ // {
108
+ // Directory.CreateDirectory(folder);
109
+ // AssetDatabase.Refresh();
110
+ // }
111
+ //
112
+ // AssetDatabase.CreateAsset(_instance, ASSET_PATH);
113
+ // AssetDatabase.Refresh();
114
+ // }
115
+ // }
116
+ // #endif
117
+ // return _instance;
118
+ // }
119
+ // }
120
+
92
121
  private static SdkTestInUnity _instance = null;
122
+ private static bool _initialized = false;
93
123
 
94
124
  public static SdkTestInUnity Instance
95
125
  {
96
126
  get
97
127
  {
98
128
  #if UNITY_EDITOR
99
- if (_instance == null)
129
+ if (!_initialized)
100
130
  {
101
- _instance = AssetDatabase.LoadAssetAtPath<SdkTestInUnity>(ASSET_PATH);
102
- if (_instance == null)
103
- {
104
- _instance = CreateInstance<SdkTestInUnity>();
105
- var folder = Path.GetDirectoryName(ASSET_PATH);
106
- if (!Directory.Exists(folder))
107
- {
108
- Directory.CreateDirectory(folder);
109
- AssetDatabase.Refresh();
110
- }
111
-
112
- AssetDatabase.CreateAsset(_instance, ASSET_PATH);
113
- AssetDatabase.Refresh();
114
- }
131
+ _initialized = true;
132
+ InitializeInstance();
115
133
  }
116
134
  #endif
117
135
  return _instance;
118
136
  }
119
137
  }
138
+
139
+
140
+ #if UNITY_EDITOR
141
+ private static void InitializeInstance()
142
+ {
143
+ if (_instance != null) return;
144
+ _instance = AssetDatabase.LoadAssetAtPath<SdkTestInUnity>(ASSET_PATH);
145
+ if (_instance == null)
146
+ {
147
+ _instance = CreateInstance<SdkTestInUnity>();
148
+ var folder = Path.GetDirectoryName(ASSET_PATH);
149
+ if (!Directory.Exists(folder))
150
+ {
151
+ Directory.CreateDirectory(folder);
152
+ AssetDatabase.Refresh();
153
+ }
154
+
155
+ AssetDatabase.CreateAsset(_instance, ASSET_PATH);
156
+ AssetDatabase.SaveAssets();
157
+ AssetDatabase.Refresh();
158
+ }
159
+ }
160
+
161
+ [InitializeOnLoadMethod]
162
+ private static void EditorInitialize()
163
+ {
164
+ // 确保在编辑器加载时初始化,但不会在静态构造函数里触发
165
+ InitializeInstance();
166
+ }
167
+ #endif
120
168
  }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.1.13","description":"","unity":"2018.1","type":"tool","hideInEditor":false,"author":{"name":"Jan Zhang","email":"","url":""},"changelogUrl":"","documentationUrl":"","keywords":["typhoon"],"license":"","licensesUrl":"","customDependencies":[{"PackageName":"com.unity.nuget.newtonsoft-json","Value":"2.0.0"}],"version_log":"## [1.1.13] - 2025-08-08\r\n\r\n### 新增\n* 调整喜中游打包配置\r\n\r\n","major_flag":false,"write_time_stamp":1754667770000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
1
+ {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.1.14","description":"","unity":"2018.1","type":"tool","hideInEditor":false,"author":{"name":"Jan Zhang","email":"","url":""},"changelogUrl":"","documentationUrl":"","keywords":["typhoon"],"license":"","licensesUrl":"","customDependencies":[{"PackageName":"com.unity.nuget.newtonsoft-json","Value":"2.0.0"}],"version_log":"## [1.1.14] - 2025-08-09\r\n\r\n### 修复\n* 修复sdktestunity构建时间不对时的bug\r\n\r\n","major_flag":false,"write_time_stamp":1754672927000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}