0

Hi everyone I need a help with Unity. I need to run the method 'BuildPipeline.BuildAssetBundles' after I click a button while i'm using the built software, is it possible to do? I know that this is an editor script, but is there a way to call it in a 'non-editor script? Thanks at all

pfx
  • 20,323
  • 43
  • 37
  • 57

1 Answers1

0

No classes that are part of the UnityEditor namespace will work in a build. Unity will simply refuse to try to do it. You can use things from AssetBundle because it's a part of UnityEngine, but you can't use BuildPipeline in a build. Unity allows the UnityEditor namespace to be include only in files that are marked as being editor files, usually by being placed in folders called "Editor" and those files are excluded from the build.

You can use BuildPipeline in playmode inside of Unity Editor's player though, but that's about it.

AnLog
  • 796
  • 1
  • 7
  • 15