Last active
December 16, 2022 12:17
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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