Game Development Reference
In-Depth Information
If this happens, you will need to compensate with a minor update to the singleton script in
Assets\Scripts\Classes and update the OnDestroy method with the following
code:
public void OnDestroy()
{
#if !UNITY_METRO
applicationIsQuitting = true;
#endif
}
By specifying !UNITY_METRO , we are stating that this code should be run on all plat-
forms except Windows 8 (in the last tested build 4.5.2, Windows phone was unaffected).
If you find this occurring on other platforms, add them to the ignore list. Consider the fol-
lowing instance:
#if !UNITY_METRO && !UNITY_ANDROID
This process doesn't actually destroy the singleton script as it is recreated each time it is
used (if it has already been destroyed). However, this flag is there to ensure that it is not
recreated when the application is actually shutting down.
Search WWH ::




Custom Search