This repository was archived by the owner on Jul 11, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ ChangeState<StartState>();
161
161
162
162
资源加载使用` async-await ` 来做异步加载资源
163
163
164
- 1 . 资源加载
164
+ 1 . 资源加载(异步加载 )
165
165
166
166
``` csharp
167
167
// 加载普通资源
@@ -171,7 +171,16 @@ GameObject obj = await GameFrameworkMode.GetModule<ResourceManager>().LoadAsset<
171
171
GameObject player = Instantiate (obj );
172
172
```
173
173
174
- 2 . 内置对象池
174
+ 2 . 资源加载(同步加载)
175
+
176
+ ``` csharp
177
+ // 先加载assetbundle
178
+ GameFrameworkMode .GetModule <ResourceManager >().LoadAssetBundle (" hotfix" );
179
+ // 再加载资源
180
+ GameFrameworkMode .GetModule <ResourceManager >().LoadAssetSync (" hotfix" ," main" );
181
+ ```
182
+
183
+ 3 . 内置对象池
175
184
176
185
* 添加预设
177
186
``` csharp
@@ -187,13 +196,13 @@ GameObject player= GameFrameworkMode.GetModule<ResourceManager>().Spawn("Assets/
187
196
GameFrameworkMode .GetModule <ResourceManager >().Despawn (player );
188
197
```
189
198
190
- 3 . 加载场景,场景只支持异步加载
199
+ 4 . 加载场景,场景只支持异步加载
191
200
192
201
``` csharp
193
202
AsyncOperation asyncOperation = await GameFrameworkMode .GetModule <ResourceManager >().LoadSceneAsync (" mainscene" ," Assets/Scene/Main.unity" );
194
203
```
195
204
196
- 4 . 支持编辑器内资源的直接读取和AssetBundle资源读取两种方式的一键切换,避免测试的时候需要重复的打包AssetBundle资源
205
+ 5 . 支持编辑器内资源的直接读取和AssetBundle资源读取两种方式的一键切换,避免测试的时候需要重复的打包AssetBundle资源
197
206
198
207
---
199
208
You can’t perform that action at this time.
0 commit comments