Skip to content

Instantly share code, notes, and snippets.

@reneabreu
Last active December 16, 2022 12:17
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save reneabreu/dd44b6ca9c089cd20a5c384c318c6e04 to your computer and use it in GitHub Desktop.
I always forget to check if Unity's splashscreen is activated, so here is a Pre-Process Build to check if i'm using Unity Plus/Pro and deactivate it for me.
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
using UnityEditor.Build;
#if UNITY_2017
class AutoHideSplashScreen : IPreprocessBuild
{
public int callbackOrder { get { return 0; } }
public void OnPreprocessBuild(BuildTarget target, string path) {
// Do the preprocessing here
if (Application.HasProLicense()) {
Debug.Log("UNITY IS PRO!\n Deactivating SplashScreen");
PlayerSettings.SplashScreen.show = false;
PlayerSettings.SplashScreen.showUnityLogo = false;
} else
Debug.Log("Unity is not pro :(");
}
}
#endif
#if UNITY_2018
using UnityEditor.Build.Reporting;
class AutoHideSplashScreen : IPreprocessBuildWithReport
{
public int callbackOrder { get { return 0; } }
public void OnPreprocessBuild(BuildReport report) {
if (Application.HasProLicense()) {
Debug.Log("UNITY IS PRO!\n Deactivating SplashScreen");
PlayerSettings.SplashScreen.show = false;
PlayerSettings.SplashScreen.showUnityLogo = false;
} else
Debug.Log("Unity is not pro :(");
}
}
#endif
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment