I was trying to get some logic to work in a PreBuild script whether the build is a development build or not using the define symbol #DEVELOPMENT_BUILD. It works in regular scripts, but apparently it doesn’t work for PreBuild scripts because the symbol won’t be defined until the build actually starts. So the #DEVELOPMENT_BUILD never actually hits even though you have “Development Build” checked in the Build Settings.
To check whether or not your build is a development build use:
var isDev = (report.summary.options & BuildOptions.Development) != 0;
In the PreBuild script it would look like this:
public void OnPreprocessBuild(BuildReport report)
{
var isDev = (report.summary.options & BuildOptions.Development) != 0;
if (isDev) {
// Is development build
} else {
// Normal build
}
}
Source: https://qiita.com/Clpsplug/items/c34e8f596e54444623ba
Related Posts
June 20, 2012
Secrets of Grindea: A Promising Old-School RPG
April 22, 2020
[Fix] Google Play – App 0 Supported Devices
April 6, 2017
[Unity3D] Copy to Clipboard Script for iOS & Android
Handy Unity3D script to copy to clipboard for mobile devices
December 15, 2017
Why Can’t I Report Scam & Phishing Emails On Outlook.com Beta?
A new beta version rolled out a few months ago and they've removed the option to mark and report an email as "Phishing scam"...



