GetAllScenes()
Returns an array of all the Scenes currently open in the hierarchy.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前
Definition
- Type: Method
- Namespace: UnityEngine.SceneManagement
- Assembly: UnityEngine.CoreModule
public static Scene[] GetAllScenes()
Returns
Type | Description |
|---|---|
| Scene[] | Array of Scenes in the Hierarchy. |
Remarks
This list will contain all the Scenes currently open in the hierarchy. This is not necessarily the same as all the Scenes that exist in your project, or that are listed in the Build Settings.
using UnityEngine;using UnityEngine.SceneManagement;public class ExampleScript : MonoBehaviour{ void Start() { Scene[] scenes = SceneManager.GetAllScenes(); foreach (Scene sc in scenes) Debug.Log("'" + sc.name + "'"); }}
This API is obsolete. Please use SceneManager.sceneCount and SceneManager.GetSceneAt() instead.