Skip to content

Commit 8bdb884

Browse files
committed
Update mobile warning script
1 parent d2991a8 commit 8bdb884

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

Assets/Scripts/Editor/RemoveMobileSupportWarningWebBuild.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
2-
// <copyright file="RemoveMobileSupportWarningWebBuild.cs" company="Supyrb">
3-
// Copyright (c) 2020 Supyrb. All rights reserved.
2+
// <copyright file="RemoveMobileSupportWarningWebBuild.cs">
3+
// Copyright (c) 2021 Johannes Deml. All rights reserved.
44
// </copyright>
55
// <author>
66
// Johannes Deml
@@ -15,8 +15,13 @@
1515

1616
namespace Supyrb
1717
{
18+
/// <summary>
19+
/// removes a warning popup for mobile builds, that this platform might not be supported:
20+
/// "Please note that Unity WebGL is not currently supported on mobiles. Press OK if you wish to continue anyway."
21+
/// </summary>
1822
public class RemoveMobileSupportWarningWebBuild
1923
{
24+
#if !UNITY_2020_1_OR_NEWER //Not needed anymore in 2020 and above
2025
[PostProcessBuild]
2126
public static void OnPostProcessBuild(BuildTarget target, string targetPath)
2227
{
@@ -35,9 +40,10 @@ public static void OnPostProcessBuild(BuildTarget target, string targetPath)
3540
var text = File.ReadAllText(filePath);
3641
text = text.Replace("UnityLoader.SystemInfo.mobile", "false");
3742

38-
Debug.Log("Removing iOS warning from " + filePath);
43+
Debug.Log("Removing mobile warning from " + filePath);
3944
File.WriteAllText(filePath, text);
4045
}
4146
}
47+
#endif
4248
}
4349
}

0 commit comments

Comments
 (0)