I am using Unity 4.0 Pro trial version on Windows-7 and I am trying to automate the build process.
I have a javascript under Editor folder, with only following 5 lines :
MyProject/Assets/Common/Editor/BuildAutomation.js
static void PerformBuild ()
{
string[] scenes = { "Assets/Scenes/my_scene" };
BuildPipeline.BuildPlayer(scenes, 'TestMyScene',BuildTarget.Android, BuildOptions.None);
}
The problem is that the script is throwing compilation errors:
-
Assets/Common/Editor/BuildAutomation.js(3,8): BCE0043: Unexpected token: void.
-
Assets/Common/Editor/BuildAutomation.js(3,28): UCE0001: ‘;’ expected. Insert a semicolon at the end.
-
Assets/Common/Editor/BuildAutomation.js(5,11): BCE0044: expecting :, found ‘[’.
I copied javascript from CommandLineArguments
And I am referring to the following docs:
BuildTarget,
BuildPipeline
I am new to Unity and the above errors look pretty basic. I am sure I am missing something very obvious. I have tried searching google, and I am unable to find the cause.
Kindly assist. Any pointers, links, docs, suggestion will be helpful.
Thanks for attention.