FairyGUI-unity icon indicating copy to clipboard operation
FairyGUI-unity copied to clipboard

Cutscene Scenes not auto added to build

Open CrandellWS opened this issue 6 years ago • 6 comments

http://answers.unity.com/answers/244170/view.html With the scene asset reference, you can use the AssetDatabase object to get path information, and manually add the scene data to the build settings list of scenes.

 public Object[] mySceneAssets;

 List<EditorBuilderSettingsScene> scenes = new List<EditorBuilderSettingsScene>();
 //have some sort of for loop to cycle through scenes...
 string pathToScene = AssetDatabase.GetAssetPath(mySceneAssets[i]);
 EditorBuildSettingsScene scene = new EditorBuildSettingsScene(pathToScene, true);
 scenes.Add(scene);
 //later on...
 EditorBuildSettings.scenes = scenes.ToArray();

CrandellWS avatar Jan 10 '19 11:01 CrandellWS

perhaps this might be better https://docs.unity3d.com/ScriptReference/EditorBuildSettings-scenes.html

CrandellWS avatar Jan 10 '19 11:01 CrandellWS

and a third way

https://forum.unity.com/threads/how-to-add-scenes-in-build-with-script-with-editorbuildsettings-scenes.116210/

CrandellWS avatar Jan 10 '19 11:01 CrandellWS

https://forum.unity.com/threads/how-to-link-scenes-in-the-inspector.383140/

CrandellWS avatar Jan 10 '19 12:01 CrandellWS

Thanks, will check it later

xiaoguzhu avatar Jan 10 '19 14:01 xiaoguzhu

that simplifies some of it for the end user it does work but there is a lot of room for error...

CrandellWS avatar Jan 10 '19 20:01 CrandellWS

thank you for your work screenshot from 2019-01-10 15-33-00

CrandellWS avatar Jan 10 '19 20:01 CrandellWS