概要
using UnityEditor; using UnityEditor.SceneTemplate; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var sceneTemplateAssetPath = "【.scenetemplate のパス】"; var scenePath = "【.unity のパス】"; var sceneTemplateAsset = AssetDatabase.LoadAssetAtPath<SceneTemplateAsset>( sceneTemplateAssetPath ); var result = SceneTemplateService.Instantiate( sceneTemplateAsset, false, scenePath ); Debug.Log( result.scene ); Debug.Log( result.sceneAsset ); } }