com.robotsquid.squidhub 0.5.9 → 0.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/Editor/SquidHubAudit.cs +36 -0
- package/README.md +9 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.10
|
|
4
|
+
|
|
5
|
+
**Fullscreen: the check that makes it actually work.**
|
|
6
|
+
|
|
7
|
+
`Check WebGL Settings` and every build now warn when **Run In Background** is
|
|
8
|
+
off. Unity WebGL pauses its main loop when the canvas loses focus, and on
|
|
9
|
+
SquidHub every control the player can see — mute, fullscreen, the back link —
|
|
10
|
+
belongs to the PORTAL, in the parent document. Clicking one takes focus off the
|
|
11
|
+
canvas and stops the game.
|
|
12
|
+
|
|
13
|
+
⚠️ **Fullscreen is where it shows, and the pause is invisible.** The portal
|
|
14
|
+
fullscreens its own container, the frame gets bigger and the canvas CSS box
|
|
15
|
+
grows — but the engine loop is what syncs the WebGL render target to that box.
|
|
16
|
+
A paused game keeps drawing at the old resolution and is upscaled across the
|
|
17
|
+
whole screen. Measured: a 2560x1290 frame still rendering a 1800x1120 target,
|
|
18
|
+
unchanged after 24 seconds, correct within two seconds of a real click into the
|
|
19
|
+
game. A player sees a blurry game that sharpens when they touch it, which nobody
|
|
20
|
+
ever reports as a focus bug.
|
|
21
|
+
|
|
22
|
+
⚠️ **A warning, not fatal.** The build runs, and a game that is genuinely
|
|
23
|
+
unplayable unfocused is entitled to pause. It is the wrong default here, not an
|
|
24
|
+
impossibility.
|
|
25
|
+
|
|
26
|
+
**And the button only exists if you declare it.** `display.fullscreen` defaults
|
|
27
|
+
to false, so the portal draws no fullscreen control at all until the manifest
|
|
28
|
+
opts in — tick **Fullscreen button** in `SquidHub → Game Manifest…`. That is
|
|
29
|
+
separate from this check, and both are needed.
|
|
30
|
+
|
|
3
31
|
## 0.5.9
|
|
4
32
|
|
|
5
33
|
**Build and Upload just uploads.** The "Upload N files (X MB)?" confirmation is
|
package/Editor/SquidHubAudit.cs
CHANGED
|
@@ -38,6 +38,7 @@ namespace SquidHub.Editor
|
|
|
38
38
|
CheckJslib(findings);
|
|
39
39
|
CheckThreads(findings);
|
|
40
40
|
CheckCompression(findings);
|
|
41
|
+
CheckRunInBackground(findings);
|
|
41
42
|
|
|
42
43
|
return findings;
|
|
43
44
|
}
|
|
@@ -106,6 +107,41 @@ namespace SquidHub.Editor
|
|
|
106
107
|
"Player Settings > Publishing Settings > Compression Format to Disabled.");
|
|
107
108
|
}
|
|
108
109
|
|
|
110
|
+
/// <summary>
|
|
111
|
+
/// ⚠️ Unity WebGL PAUSES ITS MAIN LOOP when the canvas loses focus, and on
|
|
112
|
+
/// this platform the canvas loses focus constantly: every control the
|
|
113
|
+
/// player can see — mute, fullscreen, the back link — belongs to the
|
|
114
|
+
/// PORTAL, in the parent document, not to the game. Clicking any of them
|
|
115
|
+
/// takes focus off the canvas and stops the game.
|
|
116
|
+
///
|
|
117
|
+
/// ⚠️ The worst of it is fullscreen, because the pause is invisible. The
|
|
118
|
+
/// portal fullscreens its own container, the frame gets bigger, and the
|
|
119
|
+
/// canvas CSS box grows — but the engine loop is what syncs the WebGL
|
|
120
|
+
/// render target to that box, so a paused game keeps rendering at the old
|
|
121
|
+
/// resolution and is upscaled across the whole screen. Measured here: a
|
|
122
|
+
/// 2560x1290 frame still drawing a 1800x1120 target, unchanged after 24
|
|
123
|
+
/// seconds, and correct within two seconds of a real click into the game.
|
|
124
|
+
/// The player sees a blurry game that sharpens when they touch it, which
|
|
125
|
+
/// nobody reports as a focus bug.
|
|
126
|
+
///
|
|
127
|
+
/// ⚠️ A WARNING, not fatal. The build runs, and a game that is genuinely
|
|
128
|
+
/// unplayable unfocused — a turn-based puzzle, say — is entitled to
|
|
129
|
+
/// pause. It is the wrong default here, not an impossibility.
|
|
130
|
+
/// </summary>
|
|
131
|
+
private static void CheckRunInBackground(List<Finding> findings)
|
|
132
|
+
{
|
|
133
|
+
if (PlayerSettings.runInBackground) return;
|
|
134
|
+
|
|
135
|
+
Warn(findings,
|
|
136
|
+
"Run In Background is off (Player Settings > Resolution and Presentation). " +
|
|
137
|
+
"Unity WebGL pauses when the canvas loses focus, and on SquidHub every visible " +
|
|
138
|
+
"control belongs to the portal rather than to the game — so the mute and " +
|
|
139
|
+
"fullscreen buttons stop the game as a side effect of being clicked. " +
|
|
140
|
+
"Fullscreen is the one that shows: the frame grows, the paused engine never " +
|
|
141
|
+
"resizes its render target to match, and the game is upscaled and blurry until " +
|
|
142
|
+
"the player clicks into it. Turn it on.");
|
|
143
|
+
}
|
|
144
|
+
|
|
109
145
|
private static bool AllowsThreads()
|
|
110
146
|
{
|
|
111
147
|
var defines = PlayerSettings.GetScriptingDefineSymbols(NamedBuildTarget.WebGL);
|
package/README.md
CHANGED
|
@@ -175,6 +175,7 @@ The package checks these for you, but for reference:
|
|
|
175
175
|
| Setting | Value | Why |
|
|
176
176
|
|---|---|---|
|
|
177
177
|
| Native C/C++ Multithreading | **off** | SquidHub's default tier is not cross-origin isolated, so `SharedArrayBuffer` does not exist. A pthreads build cannot start. Ask about the isolated tier if you genuinely need threads — it carries no ads |
|
|
178
|
+
| Run In Background | **on** | ⚠️ Unity WebGL pauses when the canvas loses focus, and every control on SquidHub — mute, fullscreen, back — belongs to the portal, not the game. Left off, clicking any of them stops the game; fullscreen then keeps rendering at the pre-fullscreen resolution, so the game is blurry until the player clicks into it |
|
|
178
179
|
| Compression Format | **Disabled** | ⚠️ Required, and the build is refused otherwise. SquidHub stores assets uncompressed and Cloudflare compresses them at the edge, per client. A precompressed build cannot be served correctly at all |
|
|
179
180
|
|
|
180
181
|
## Things that will otherwise bite
|
|
@@ -189,6 +190,14 @@ data:`. A CDN font, a remote texture or a third-party analytics snippet is
|
|
|
189
190
|
blocked at load and shows up as a console error, not as a missing style.
|
|
190
191
|
Everything must ship inside the build.
|
|
191
192
|
|
|
193
|
+
⚠️ **Fullscreen needs two things, and neither is the Unity fullscreen button.**
|
|
194
|
+
Tick **Fullscreen button** in `SquidHub → Game Manifest…` — `display.fullscreen`
|
|
195
|
+
defaults to false and the portal draws no control without it — and turn on **Run
|
|
196
|
+
In Background**, or the game pauses the moment the player clicks that control and
|
|
197
|
+
stays at the old resolution while the frame grows. The portal fullscreens its own
|
|
198
|
+
container rather than asking your game to do it, so your build needs no fullscreen
|
|
199
|
+
code at all; Unity's own button is hidden for you.
|
|
200
|
+
|
|
192
201
|
⚠️ **Do not write your own rotate prompt or call `screen.orientation.lock()`.**
|
|
193
202
|
Declare the orientations you support in `SquidHub → Game Manifest…` and the
|
|
194
203
|
portal draws the prompt outside your frame. Two prompts fight, and yours is the one the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "com.robotsquid.squidhub",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10",
|
|
4
4
|
"displayName": "SquidHub",
|
|
5
5
|
"description": "Cloud saves, analytics and the coin economy for Unity WebGL games published on SquidHub. Installs the C# wrapper, the .jslib half and the page bridge, and rewrites the exported index.html so it survives the platform's CSP.",
|
|
6
6
|
"unity": "2021.3",
|