0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Unity】現在のシーンを取得するコード

Posted at

メモ

環境

・Window11
・Unity2022.3.23f1

コード

SceneManager.GetActiveScene().name

サンプルコード

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement; // 必要

public class Timer : MonoBehaviour
{
    void Start()
    {
        Debug.Log(SceneManager.GetActiveScene().name);
    }
}

終わり

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?