Skip to content

Commit 9fbee64

Browse files
committed
Created UnitySkipSplashScreen
1 parent 4c08b36 commit 9fbee64

11 files changed

+139
-2
lines changed

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# Auto detect text files and perform LF normalization
2-
* text=auto
1+
* text=auto

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**.idea

LICENSE.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "RimuruDev.UnitySkipSplashScreen",
3+
"rootNamespace": "",
4+
"references": [],
5+
"includePlatforms": [],
6+
"excludePlatforms": [],
7+
"allowUnsafeCode": false,
8+
"overrideReferences": false,
9+
"precompiledReferences": [],
10+
"autoReferenced": true,
11+
"defineConstraints": [],
12+
"versionDefines": [],
13+
"noEngineReferences": false
14+
}

RimuruDev.UnitySkipSplashScreen.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SetSplashScreenBlack.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Resharper disable all
2+
// **************************************************************** //
3+
//
4+
// Copyright (c) RimuruDev. All rights reserved.
5+
// Contact me:
6+
// - Gmail: rimuru.dev@gmail.com
7+
// - GitHub: https://github.com/RimuruDev
8+
// - LinkedIn: https://www.linkedin.com/in/rimuru/
9+
// - GitHub Organizations: https://github.com/Rimuru-Dev
10+
// - GitHubRepo: https://github.com/RimuruDev/UnitySkipSplashScreen.git
11+
//
12+
// **************************************************************** //
13+
14+
#if UNITY_EDITOR
15+
using UnityEditor;
16+
using UnityEngine;
17+
using UnityEditor.Build;
18+
using UnityEditor.Build.Reporting;
19+
20+
public sealed class SetSplashScreenBlack : IPreprocessBuildWithReport
21+
{
22+
public int callbackOrder { get; }
23+
24+
public void OnPreprocessBuild(BuildReport report)
25+
{
26+
PlayerSettings.SplashScreen.unityLogoStyle = PlayerSettings.SplashScreen.UnityLogoStyle.LightOnDark;
27+
PlayerSettings.SplashScreen.backgroundColor = Color.black;
28+
}
29+
}
30+
#endif

SetSplashScreenBlack.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitySkipSplashScreen.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Resharper disable all
2+
// **************************************************************** //
3+
//
4+
// Copyright (c) RimuruDev. All rights reserved.
5+
// Contact me:
6+
// - Gmail: rimuru.dev@gmail.com
7+
// - GitHub: https://github.com/RimuruDev
8+
// - LinkedIn: https://www.linkedin.com/in/rimuru/
9+
// - GitHub Organizations: https://github.com/Rimuru-Dev
10+
// - GitHubRepo: https://github.com/RimuruDev/UnitySkipSplashScreen.git
11+
//
12+
// **************************************************************** //
13+
14+
#if !UNITY_EDITOR
15+
using UnityEngine;
16+
using UnityEngine.Rendering;
17+
18+
public sealed class UnitySkipSplashScreen
19+
{
20+
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
21+
private static void BeforeSplashScreen()
22+
{
23+
#if UNITY_WEBGL
24+
Application.focusChanged += Application_focusChanged;
25+
#else
26+
System.Threading.Tasks.Task.Run(AsyncSkip);
27+
#endif
28+
}
29+
30+
#if UNITY_WEBGL
31+
private static void Application_focusChanged(bool obj)
32+
{
33+
Application.focusChanged -= Application_focusChanged;
34+
SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
35+
}
36+
37+
#else
38+
private static void AsyncSkip() =>
39+
SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
40+
#endif
41+
}
42+
#endif

UnitySkipSplashScreen.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "com.rimurudev.unity-skip-splashscreen",
3+
"displayName": "Unity Skip Splash",
4+
"version": "1.0.0",
5+
"unity": "2019.4",
6+
"description": "A script to skip the Unity logo splash.",
7+
"keywords": [
8+
"Splash",
9+
"Unity",
10+
"SplashScreen",
11+
"UnitySplashScreen"
12+
],
13+
"repository": {
14+
"url": "https://github.com/RimuruDev/UnitySkipSplashScreen.git"
15+
}
16+
}

package.json.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)