Skip to content

Commit 4571ca7

Browse files
committed
Change remove mobile warning message
1 parent ffe2e9a commit 4571ca7

6 files changed

+76
-11
lines changed

Assets/Scripts/ConstantRotation.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright file="ConstantRotation.cs" company="Supyrb">
3-
// Copyright (c) 2017 Supyrb. All rights reserved.
3+
// Copyright (c) 2019 Supyrb. All rights reserved.
44
// </copyright>
55
// <author>
66
// Johannes Deml
7-
// send@johannesdeml.com
7+
// public@deml.io
88
// </author>
99
// --------------------------------------------------------------------------------------------------------------------
1010

@@ -107,7 +107,7 @@ public void SetZRotationAxis(float z)
107107
void OnDrawGizmosSelected()
108108
{
109109
Gizmos.color = Color.yellow;
110-
Gizmos.DrawRay(transform.position, (space == Space.Self) ? transform.rotation * rotationAxis.normalized : rotationAxis.normalized);
110+
Gizmos.DrawRay(transform.position, space == Space.Self ? transform.rotation * rotationAxis.normalized : rotationAxis.normalized);
111111
}
112112
#endif
113113
}

Assets/Scripts/Editor.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright file="RemoveMobileSupportWarningWebBuild.cs" company="Supyrb">
3+
// Copyright (c) 2020 Supyrb. All rights reserved.
4+
// </copyright>
5+
// <author>
6+
// Johannes Deml
7+
// public@deml.io
8+
// </author>
9+
// --------------------------------------------------------------------------------------------------------------------
10+
11+
using System.IO;
12+
using UnityEditor;
13+
using UnityEditor.Callbacks;
14+
using UnityEngine;
15+
16+
namespace Supyrb
17+
{
18+
public class RemoveMobileSupportWarningWebBuild
19+
{
20+
[PostProcessBuild]
21+
public static void OnPostProcessBuild(BuildTarget target, string targetPath)
22+
{
23+
if (target != BuildTarget.WebGL)
24+
{
25+
return;
26+
}
27+
28+
var buildFolderPath = Path.Combine(targetPath, "Build");
29+
var info = new DirectoryInfo(buildFolderPath);
30+
var files = info.GetFiles("*.js");
31+
for (int i = 0; i < files.Length; i++)
32+
{
33+
var file = files[i];
34+
var filePath = file.FullName;
35+
var text = File.ReadAllText(filePath);
36+
text = text.Replace("UnityLoader.SystemInfo.mobile", "false");
37+
38+
Debug.Log("Removing iOS warning from " + filePath);
39+
File.WriteAllText(filePath, text);
40+
}
41+
}
42+
}
43+
}

Assets/Scripts/Editor/RemoveMobileSupportWarningWebBuild.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.

Assets/Scripts/ObjectSpawner.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright file="ObjectSpawner.cs" company="Supyrb">
3-
// Copyright (c) 2018 Supyrb. All rights reserved.
3+
// Copyright (c) 2019 Supyrb. All rights reserved.
44
// </copyright>
55
// <author>
66
// Johannes Deml
7-
// send@johannesdeml.com
7+
// public@deml.io
88
// </author>
99
// --------------------------------------------------------------------------------------------------------------------
1010

@@ -21,7 +21,7 @@ public class ObjectSpawner : MonoBehaviour
2121

2222
[SerializeField]
2323
private int maxInstances = 200;
24-
24+
2525
private int counter = 0;
2626
private int instances = 0;
2727
private Queue<GameObject> spawnedObjects = null;
@@ -30,7 +30,7 @@ void Awake()
3030
{
3131
spawnedObjects = new Queue<GameObject>(maxInstances + 5);
3232
}
33-
33+
3434
void Update()
3535
{
3636
counter++;
@@ -51,12 +51,12 @@ private void SpawnObject()
5151
spawnedObjects.Enqueue(recycleGo);
5252
return;
5353
}
54-
54+
5555
var newGo = Instantiate(prefab, transform.position, transform.rotation);
5656
spawnedObjects.Enqueue(newGo);
5757
instances++;
5858
}
59-
59+
6060
#if UNITY_EDITOR
6161
private void OnDrawGizmos()
6262
{

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
![Preview](./preview.png)
44

5-
Simple test for how good unity is at handling WebGL.
5+
Testing Unity's WebGL capabilities for different versions and Platforms
66

77
Version | Size | Link
88
--- | --- | ---
99
2018.2.3f1 | 2.97 MB (3,121,037 bytes) | https://deml.io/experiments/unity-webgl/2018.2.3f1/
1010
2019.3.0b8 | 4.06 MB (4,257,932 bytes) | https://deml.io/experiments/unity-webgl/2019.3.0b8/
1111
2019.3.0f6 | 3.28 MB (3,448,034 bytes) | https://deml.io/experiments/unity-webgl/2019.3.0f6/
1212

13-
The server is configured to support wasm streaming, see [.htaccess file](./Configuration/.htaccess)
13+
## Notes
14+
* The server is configured to support wasm streaming, see [.htaccess file](./Configuration/.htaccess)
15+
* In order to get rid of the warning on iOS it is removed in a post process build step ([File](./Assets/Scripts/Editor/RemoveMobileSupportWarningWebBuild.cs))
16+
1417
For further information check out the [forum-thread](https://forum.unity.com/threads/webgl-builds-for-mobile.545877/).

0 commit comments

Comments
 (0)