Create a Custom prebuild call
This is an example of including prebuild in your building procedure.
//using System.IO;
//using Wonderland
public const string PrebuildPath = "Game";
private System.DateTime _lastPrebuild;
Vector2 _scrollPrebuild = Vector2.zero;
private Dictionary<string, string> _lastPrebuildContent = new Dictionary<string, string>();
void Prebuild() {
_scrollPrebuild = Vector2.zero;
_lastPrebuildContent.Clear();
// get the game folder
var gameFolder = Path.Combine(Application.dataPath, PrebuildPath);
// get all script infos
var scriptInfos = Prebuild.Start(gameFolder);
foreach (var scriptInfo in scriptInfos) {
_lastPrebuildContent[scriptInfo.FullName] = "Ready";
// generates new script content
Prebuild.PrepareContent(scriptInfo);
_lastPrebuildContent[scriptInfo.FullName] = "Prepared";
// writes the script file
Prebuild.WriteContent(scriptInfo);
_lastPrebuildContent[scriptInfo.FullName] = "OK";
// at this point, if the script has references, the writing may be delayed
}
_lastPrebuild = System.DateTime.Now;
}