ドキュメント

Unity Engine

Unity Engine

scene

The Scene that contains the GameObject.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public Scene scene { get; }

Examples

//Output the name of the Scene this GameObject belongs tousing UnityEngine;using UnityEngine.SceneManagement;public class Example : MonoBehaviour{ void Start() { Scene scene = gameObject.scene; Debug.Log(gameObject.name + " is from the Scene: " + scene.name); }}