Content-Length: 18905 | pFad | https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/GameObject-scene.html
The Scene that contains the GameObject.
//Output the name of the Scene this GameObject belongs to
using UnityEngine; using UnityEngine.SceneManagement;
public class Example : MonoBehaviour { void Start() { Scene scene = gameObject.scene; Debug.Log(gameObject.name + " is from the Scene: " + scene.name); } }
Fetched URL: https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/GameObject-scene.html
Alternative Proxies: