Hello everyone. I'm still fairly new to Unity, so this is likely something small I'm overlooking. I've been searching for quite a while now and haven't found anything resembling the same problem I'm having.
I'm using Unity Pro and trying save a Unity scene as a streamable .unity3d file. I've literally created a new Unity project and copied and pasted the example code provided in the scripting reference (link text) into a new script. When I try to run the script (and compile this scene, which is just the default main camera), I briefly see a popup that reads "Compiling scripts" and then it crashes.
I receive two errors:
Assets/SaveScene.js(1,2): BCE0064: No attribute with the name 'MenuItem' or 'MenuItemAttribute' was found (attribute names are case insensitive).
Error building Player because scripts had compiler errors UnityEditor.BuildPipeline:BuildStreamedSceneAssetBundle(String, String, BuildTarget) SaveScene:MyBuild() (at Assets/SaveScene.js:4)
Does anyone have any idea what might be causing the crash? Should Unity even be trying to compile scripts that the scene isn't dependent upon?
I have figured this out. What you have to do is pick the menu item that was created by your script, then BEFORE you select your scene to build the asset bundle for, you have to go back and comment out all of the script in the .cs or .js file that builds the menu items in your UI. What's happening is the unity player is trying to compile the script and it is not working. If you comment it out before it builds the asset bundle, it won't see the script and therefore, won't error out.
Unfortunately I too am having this problem. Using Unity 3.4.1 I have scenes that run fine but do not build with BuildPipeline.BuildStreamedSceneAssetBundle or BuildPipeline.BuildPlayer. Yet I have tried to build a single empty scene. I receive these errors.
Assets/Scripts/exporting/AutomatedExportResources.js(1,2): BCE0064: No attribute with the name 'MenuItem' or 'MenuItemAttribute' was found (attribute names are case insensitive). and
Error building Player because scripts had compiler errors UnityEditor.BuildPipeline:BuildPlayer(String, String, BuildTarget, BuildOptions)
The compile process appears to be building much more than I anticipate for the empty scene. Is there a way to print or view the dependancies that the build methods BuildStreamedSceneAssetBundle or BuildPipeline.BuildPlayer are gathering?