以下の内容はhttps://baba-s.hatenablog.com/entry/2018/08/20/160000より取得しました。


【Unity】変数にシーンの参照を設定できる「UnityEditorJunkie」紹介

はじめに

「UnityEditorJunkie」を Unity プロジェクトに導入することで
変数にシーンの参照を設定できるようになります

使い方

using RoboRyanTron.SceneReference;
using UnityEngine;

public class Example : MonoBehaviour
{
    public SceneReference sceneA;
    public SceneReference sceneB;

    public void LoadSceneA()
    {
        sceneA.LoadScene();
    }

    public void LoadSceneB()
    {
        sceneB.LoadScene();
    }
}

SceneReference 型の変数を定義することで

f:id:baba_s:20180812095428p:plain

Inspector で変数にシーンの参照を設定できるようになります

Build Settings に設定されていない、もしくは
Build Settings で無効化されているシーンにはエラーアイコンが表示されます




以上の内容はhttps://baba-s.hatenablog.com/entry/2018/08/20/160000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14