UnityAPI_SceneManager

SceneManager:在运行的时候对场景进行管理


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
//
// 摘要:
//     ///
//     构建的场景数目
//     ///
public  static  int  sceneCountInBuildSettings {  get ; }
//
// 摘要:
//     ///
//     当前已经加载的场景数目
//     ///
public  static  int  sceneCount {  get ; }
 
public  static  event  UnityAction<Scene, LoadSceneMode> sceneLoaded; //事件,当场景加载完成时
public  static  event  UnityAction<Scene> sceneUnloaded; //
public  static  event  UnityAction<Scene, Scene> activeSceneChanged;
 
//
// 摘要:
//     ///
//     根据给出的名字创建一个场景
//     ///
//
// 参数:
//   sceneName:
//     不能为空,不能和已存在的场景名称相同
//
// 返回结果:
//     ///
//     A reference to the new scene that was created, or an invalid scene if creation
//     failed.
//     ///
public  static  Scene CreateScene( string  sceneName);
//
// 摘要:
//     ///
//     获取当前激活的场景
//     ///
//
// 返回结果:
//     ///
//     The active scene.
//     ///
public  static  Scene GetActiveScene();
 
// 摘要:
//     ///
//     根据序号从场景列表中获取场景
//     ///
//
// 参数:
//   index:
//     Index of the scene to get. Index must be greater than or equal to 0 and less
//     than SceneManager.sceneCount.
//
// 返回结果:
//     ///
//     A reference to the scene at the index specified.
//     ///
public  static  Scene GetSceneAt( int  index);
//
// 摘要:
//     ///
//     Get a scene struct from a build index.
//     ///
//
// 参数:
//   buildIndex:
//     Build index as shown in the Build Settings window.
//
// 返回结果:
//     ///
//     A reference to the scene, if valid. If not, an invalid scene is returned.
//     ///
public  static  Scene GetSceneByBuildIndex( int  buildIndex);
//
// 摘要:
//     ///
//     Searches through the scenes added to the SceneManager for a scene with the given
//     name.
//     ///
//
// 参数:
//   name:
//     Name of scene to find.
//
// 返回结果:
//     ///
//     A reference to the scene, if valid. If not, an invalid scene is returned.
//     ///
public  static  Scene GetSceneByName( string  name);
//
// 摘要:
//     ///
//     Searches all scenes added to the SceneManager for a scene that has the given
//     asset path.
//     ///
//
// 参数:
//   scenePath:
//     Path of the scene. Should be relative to the project folder. Like: "AssetsMyScenesMyScene.unity".
//
// 返回结果:
//     ///
//     A reference to the scene, if valid. If not, an invalid scene is returned.
//     ///
public  static  Scene GetSceneByPath( string  scenePath);
[ExcludeFromDocs]
public  static  void  LoadScene( string  sceneName);
//
// 摘要:
//     ///
//     Loads the scene by its name or index in Build Settings.
//     ///
//
// 参数:
//   sceneName:
//     Name or path of the scene to load.
//
//   sceneBuildIndex:
//     Index of the scene in the Build Settings to load.
//
//   mode:
//     Allows you to specify whether or not to load the scene additively. /// See SceneManagement.LoadSceneMode
//     for more information about the options.
public  static  void  LoadScene( string  sceneName, [DefaultValue( "LoadSceneMode.Single" )] LoadSceneMode mode);
[ExcludeFromDocs]
public  static  void  LoadScene( int  sceneBuildIndex);
//
// 摘要:
//     ///
//     Loads the scene by its name or index in Build Settings.
//     ///
//
// 参数:
//   sceneName:
//     Name or path of the scene to load.
//
//   sceneBuildIndex:
//     Index of the scene in the Build Settings to load.
//
//   mode:
//     Allows you to specify whether or not to load the scene additively. /// See SceneManagement.LoadSceneMode
//     for more information about the options.
public  static  void  LoadScene( int  sceneBuildIndex, [DefaultValue( "LoadSceneMode.Single" )] LoadSceneMode mode);
[ExcludeFromDocs]
public  static  AsyncOperation LoadSceneAsync( int  sceneBuildIndex);
//
// 摘要:
//     ///
//     Loads the scene asynchronously in the background.
//     ///
//
// 参数:
//   sceneName:
//     Name or path of the scene to load.
//
//   sceneBuildIndex:
//     Index of the scene in the Build Settings to load.
//
//   mode:
//     If LoadSceneMode.Single then all current scenes will be unloaded before loading.
//
// 返回结果:
//     ///
//     Use the AsyncOperation to determine if the operation has completed.
//     ///
public  static  AsyncOperation LoadSceneAsync( string  sceneName, [DefaultValue( "LoadSceneMode.Single" )] LoadSceneMode mode);
[ExcludeFromDocs]
public  static  AsyncOperation LoadSceneAsync( string  sceneName);
//
// 摘要:
//     ///
//     Loads the scene asynchronously in the background.
//     ///
//
// 参数:
//   sceneName:
//     Name or path of the scene to load.
//
//   sceneBuildIndex:
//     Index of the scene in the Build Settings to load.
//
//   mode:
//     If LoadSceneMode.Single then all current scenes will be unloaded before loading.
//
// 返回结果:
//     ///
//     Use the AsyncOperation to determine if the operation has completed.
//     ///
public  static  AsyncOperation LoadSceneAsync( int  sceneBuildIndex, [DefaultValue( "LoadSceneMode.Single" )] LoadSceneMode mode);
//
// 摘要:
//     ///
//     合并场景
//     ///
//
// 参数:
//   sourceScene:
//     The scene that will be merged into the destination scene.
//
//   destinationScene:
//     Existing scene to merge the source scene into.
public  static  void  MergeScenes(Scene sourceScene, Scene destinationScene);
//
// 摘要:
//     ///
//     从场景中移除某个物体
//     ///
//
// 参数:
//   go:
//     GameObject to move.
//
//   scene:
//     Scene to move into.
public  static  void  MoveGameObjectToScene(GameObject go, Scene scene);
//
// 摘要:
//     ///
//     Set the scene to be active.
//     ///
//
// 参数:
//   scene:
//     The scene to be set.
//
// 返回结果:
//     ///
//     Returns false if the scene is not loaded yet.
//     ///
public  static  bool  SetActiveScene(Scene scene);
 
//
// 摘要:
//     ///
//     Destroys all GameObjects associated with the given scene and removes the scene
//     from the SceneManager.
//     ///
//
// 参数:
//   sceneBuildIndex:
//     Index of the scene in BuildSettings.
//
//   sceneName:
//     Name or path of the scene to unload.
//
//   scene:
//     Scene to unload.
//
// 返回结果:
//     ///
//     Use the AsyncOperation to determine if the operation has completed.
//     ///
public  static  AsyncOperation UnloadSceneAsync( int  sceneBuildIndex);
//
// 摘要:
//     ///
//     Destroys all GameObjects associated with the given scene and removes the scene
//     from the SceneManager.
//     ///
//
// 参数:
//   sceneBuildIndex:
//     Index of the scene in BuildSettings.
//
//   sceneName:
//     Name or path of the scene to unload.
//
//   scene:
//     Scene to unload.
//
// 返回结果:
//     ///
//     Use the AsyncOperation to determine if the operation has completed.
//     ///
public  static  AsyncOperation UnloadSceneAsync( string  sceneName);
//
// 摘要:
//     ///
//     Destroys all GameObjects associated with the given scene and removes the scene
//     from the SceneManager.
//     ///
//
// 参数:
//   sceneBuildIndex:
//     Index of the scene in BuildSettings.
//
//   sceneName:
//     Name or path of the scene to unload.
//
//   scene:
//     Scene to unload.
//
// 返回结果:
//     ///
//     Use the AsyncOperation to determine if the operation has completed.
//     ///
public  static  AsyncOperation UnloadSceneAsync(Scene scene);

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值