Skip to content

Commit 6094303

Browse files
committed
Merge branch 'master' into 6000.0
# Conflicts: # Packages/manifest.json
2 parents 72a768c + 1506734 commit 6094303

File tree

18 files changed

+292
-75
lines changed

18 files changed

+292
-75
lines changed

.github/workflows/release.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,24 @@ jobs:
7373
if: ${{ github.ref == 'refs/heads/master' || needs.variables.outputs.TAG != needs.variables.outputs.UNITY_VERSION }}
7474
needs: [ variables ]
7575
runs-on: ubuntu-latest
76-
strategy:
77-
fail-fast: false
7876
steps:
7977
- uses: actions/checkout@v4
8078
with:
8179
fetch-depth: 0
8280
lfs: true
8381

82+
# Avoid running into space issues for github runners - Docker images can take up quite some space
83+
- name: Free Disk Space
84+
run: |
85+
echo "Disk space before cleanup:"
86+
df -h
87+
sudo rm -rf /usr/share/dotnet
88+
sudo rm -rf /opt/ghc
89+
sudo rm -rf /usr/local/share/boost
90+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
91+
echo "Disk space after cleanup:"
92+
df -h
93+
8494
# Unity 2020 cache is not compatible with older versions
8595
- name: Unity Library Cache 2020 or higher
8696
if: ${{ !startsWith(needs.variables.outputs.UNITY_VERSION, '201') }}
@@ -111,6 +121,17 @@ jobs:
111121
versioning: None
112122
buildName: ${{ needs.variables.outputs.BUILD_NAME }}
113123

124+
- name: Check Disk Space After Build
125+
run: |
126+
echo "Disk space after build:"
127+
df -h
128+
AVAILABLE=$(df / | tail -1 | awk '{print $4}')
129+
AVAILABLE_GB=$(echo $AVAILABLE | sed 's/G//')
130+
echo "Available space: ${AVAILABLE_GB}GB"
131+
if (( $(echo "$AVAILABLE_GB < 1" | bc -l) )); then
132+
echo "::warning::Low disk space! Less than 1GB remaining."
133+
fi
134+
114135
- uses: actions/upload-artifact@v4
115136
with:
116137
name: ${{ needs.variables.outputs.BUILD_NAME }}

.github/workflows/upgrade-unity.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ jobs:
3434
upgrade-unity-version:
3535
name: Upgrade Unity version and packages to ${{ inputs.unityVersion }}
3636
runs-on: ubuntu-latest
37-
strategy:
38-
fail-fast: false
3937
steps:
4038
- name: Log input parameter
4139
run: |
@@ -75,6 +73,18 @@ jobs:
7573
env:
7674
GIT_USER: ${{ github.actor }}
7775

76+
# Avoid running into space issues for github runners - Docker images can take up quite some space
77+
- name: Free Disk Space
78+
run: |
79+
echo "Disk space before cleanup:"
80+
df -h
81+
sudo rm -rf /usr/share/dotnet
82+
sudo rm -rf /opt/ghc
83+
sudo rm -rf /usr/local/share/boost
84+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
85+
echo "Disk space after cleanup:"
86+
df -h
87+
7888
# Make sure the branch has the latest master changes in
7989
- name: Merge master into current branch
8090
if: ${{ inputs.mergeMaster }}
@@ -149,6 +159,18 @@ jobs:
149159
allowDirtyBuild: true
150160
manualExit: true
151161

162+
- name: Check Disk Space After Build
163+
if: ${{ !inputs.tagsOnly }}
164+
run: |
165+
echo "Disk space after build:"
166+
df -h
167+
AVAILABLE=$(df / | tail -1 | awk '{print $4}')
168+
AVAILABLE_GB=$(echo $AVAILABLE | sed 's/G//')
169+
echo "Available space: ${AVAILABLE_GB}GB"
170+
if (( $(echo "$AVAILABLE_GB < 1" | bc -l) )); then
171+
echo "::warning::Low disk space! Less than 1GB remaining."
172+
fi
173+
152174
- name: Delete build folder with elevated rights
153175
if: ${{ !inputs.tagsOnly }}
154176
run: sudo rm -rf ./build

Assets/Plugins/WebGL/WebBridge/CommonCommands.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,17 @@ public void CheckOnlineStatus()
382382
Debug.Log($"<color=#4D65A4>Online Status:</color> {(isOnline ? "<color=#3bb508>Connected</color>" : "<color=#b50808>Disconnected</color>")}");
383383
}
384384

385+
/// <summary>
386+
/// Sets the CSS cursor style for the Unity canvas element.
387+
/// Browser Usage: <code>unityGame.SendMessage("WebGL", "SetCursor", "pointer");</code>
388+
/// </summary>
389+
/// <param name="cursorName">CSS cursor value (e.g., "default", "pointer", "grab", "crosshair", "text")</param>
390+
[WebCommand(Description = "Set the CSS cursor style")]
391+
public void SetCursor(string cursorName)
392+
{
393+
WebToolPlugins.SetCursor(cursorName);
394+
}
395+
385396
/// <summary>
386397
/// Captures the current screen and saves it as a PNG file.
387398
/// </summary>

Assets/Plugins/WebGL/WebTools/EventListeners/WebEventListeners.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
using System;
1212
using System.Collections.Generic;
13+
using System.Diagnostics;
1314
using System.Runtime.InteropServices;
1415
using UnityEngine;
1516

@@ -36,6 +37,7 @@ private static void OnBeforeSceneLoadRuntimeMethod()
3637
}
3738
#endif
3839

40+
[Conditional("UNITY_WEBGL")]
3941
public static void AddEventListener(string eventName, Action callback)
4042
{
4143
instance.AddEventListenerInternal(eventName, callback);
@@ -59,7 +61,7 @@ private void AddEventListenerInternal(string eventName, Action callback)
5961
// Add event listener on javascript side
6062
_AddJsEventListener(eventName);
6163
#elif UNITY_EDITOR && WEBTOOLS_LOG_CALLS
62-
Debug.Log($"<color=#00CCCC>{nameof(WebEventListeners)}.{nameof(AddEventListenerInternal)} add callback for {eventName}</color>");
64+
UnityEngine.Debug.Log($"<color=#00CCCC>{nameof(WebEventListeners)}.{nameof(AddEventListenerInternal)} add callback for {eventName}</color>");
6365
#endif
6466
}
6567
}

Assets/Plugins/WebGL/WebTools/WebToolPlugins.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public static class WebToolPlugins
4444
private static extern void _DownloadFile(string filename, string content);
4545
[DllImport("__Internal")]
4646
private static extern void _DownloadBlob(string filename, byte[] byteArray, int byteLength, string mimeType);
47+
[DllImport("__Internal")]
48+
private static extern void _SetCursor(string cursorName);
4749

4850
#endif
4951

@@ -305,5 +307,28 @@ public static void DownloadBinaryFile(string filename, byte[] data, string mimeT
305307
Debug.Log($"{nameof(WebToolPlugins)}.{nameof(DownloadBinaryFile)} called with filename: {filename}");
306308
#endif
307309
}
310+
311+
/// <summary>
312+
/// Sets the CSS cursor style for the Unity canvas element.
313+
/// <see href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/cursor"/>
314+
/// </summary>
315+
/// <param name="cursorName">The CSS cursor value (e.g., "pointer", "grab", "crosshair", "text", "default")</param>
316+
/// <example>
317+
/// <code>
318+
/// // Example: Change cursor to pointer on hover
319+
/// WebToolPlugins.SetCursor("pointer");
320+
///
321+
/// // Example: Reset to default cursor
322+
/// WebToolPlugins.SetCursor("default");
323+
/// </code>
324+
/// </example>
325+
public static void SetCursor(string cursorName)
326+
{
327+
#if UNITY_WEBGL && !UNITY_EDITOR
328+
_SetCursor(cursorName);
329+
#elif UNITY_EDITOR && WEBTOOLS_LOG_CALLS
330+
Debug.Log($"{nameof(WebToolPlugins)}.{nameof(SetCursor)} called with cursor: {cursorName}");
331+
#endif
332+
}
308333
}
309334
}

Assets/Plugins/WebGL/WebTools/WebToolPlugins.jslib

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,21 @@ var WebGlPlugins =
154154
element.click();
155155
document.body.removeChild(element);
156156
URL.revokeObjectURL(url);
157+
},
158+
159+
_SetCursor: function(cursorName) {
160+
var cursorStr = UTF8ToString(cursorName);
161+
// Check if canvas variable exists from the Unity template
162+
var canvasElement = (typeof canvas !== 'undefined') ? canvas : null;
163+
if (!canvasElement) {
164+
canvasElement = document.getElementById('unity-canvas');
165+
}
166+
if (!canvasElement) {
167+
canvasElement = document.querySelector('canvas');
168+
}
169+
if (canvasElement) {
170+
canvasElement.style.cursor = cursorStr;
171+
}
157172
}
158173
};
159174

Assets/Prefabs/RigidbodyCube.prefab

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ GameObject:
1313
- component: {fileID: 23875290202771946}
1414
- component: {fileID: 65366149667932608}
1515
- component: {fileID: 54003196623453922}
16+
- component: {fileID: 265791508532593724}
1617
m_Layer: 0
1718
m_Name: RigidbodyCube
1819
m_TagString: Untagged
@@ -136,3 +137,17 @@ Rigidbody:
136137
m_Interpolate: 0
137138
m_Constraints: 0
138139
m_CollisionDetection: 1
140+
--- !u!114 &265791508532593724
141+
MonoBehaviour:
142+
m_ObjectHideFlags: 0
143+
m_CorrespondingSourceObject: {fileID: 0}
144+
m_PrefabInstance: {fileID: 0}
145+
m_PrefabAsset: {fileID: 0}
146+
m_GameObject: {fileID: 1293945906612296}
147+
m_Enabled: 1
148+
m_EditorHideFlags: 0
149+
m_Script: {fileID: 11500000, guid: 7cd0ca8b7204d4214b198040d886c542, type: 3}
150+
m_Name:
151+
m_EditorClassIdentifier:
152+
CursorEnteredName: pointer
153+
CursorExitedName: default

Assets/Scenes/Main.unity

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ OcclusionCullingSettings:
1313
--- !u!104 &2
1414
RenderSettings:
1515
m_ObjectHideFlags: 0
16-
serializedVersion: 9
16+
serializedVersion: 10
1717
m_Fog: 0
1818
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
1919
m_FogMode: 3
@@ -38,13 +38,12 @@ RenderSettings:
3838
m_ReflectionIntensity: 1
3939
m_CustomReflection: {fileID: 0}
4040
m_Sun: {fileID: 0}
41-
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
4241
m_UseRadianceAmbientProbe: 0
4342
--- !u!157 &3
4443
LightmapSettings:
4544
m_ObjectHideFlags: 0
46-
serializedVersion: 12
47-
m_GIWorkflowMode: 0
45+
serializedVersion: 13
46+
m_BakeOnSceneLoad: 0
4847
m_GISettings:
4948
serializedVersion: 2
5049
m_BounceScale: 1
@@ -67,9 +66,6 @@ LightmapSettings:
6766
m_LightmapParameters: {fileID: 0}
6867
m_LightmapsBakeMode: 1
6968
m_TextureCompression: 1
70-
m_FinalGather: 0
71-
m_FinalGatherFiltering: 1
72-
m_FinalGatherRayCount: 256
7369
m_ReflectionCompression: 2
7470
m_MixedBakeMode: 2
7571
m_BakeBackend: 1
@@ -198,9 +194,8 @@ Light:
198194
m_PrefabAsset: {fileID: 0}
199195
m_GameObject: {fileID: 170076733}
200196
m_Enabled: 1
201-
serializedVersion: 10
197+
serializedVersion: 11
202198
m_Type: 1
203-
m_Shape: 0
204199
m_Color: {r: 0.99215686, g: 0.96962065, b: 0.85490197, a: 1}
205200
m_Intensity: 0.7
206201
m_Range: 10
@@ -250,8 +245,12 @@ Light:
250245
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
251246
m_UseBoundingSphereOverride: 0
252247
m_UseViewFrustumForShadowCasterCull: 1
248+
m_ForceVisible: 0
253249
m_ShadowRadius: 0
254250
m_ShadowAngle: 0
251+
m_LightUnit: 1
252+
m_LuxAtDistance: 1
253+
m_EnableSpotReflector: 1
255254
--- !u!4 &170076735
256255
Transform:
257256
m_ObjectHideFlags: 0
@@ -371,6 +370,7 @@ GameObject:
371370
- component: {fileID: 624999761}
372371
- component: {fileID: 624999760}
373372
- component: {fileID: 624999759}
373+
- component: {fileID: 624999763}
374374
m_Layer: 0
375375
m_Name: GroundPlane
376376
m_TagString: Untagged
@@ -417,6 +417,9 @@ MeshRenderer:
417417
m_ReflectionProbeUsage: 1
418418
m_RayTracingMode: 2
419419
m_RayTraceProcedural: 0
420+
m_RayTracingAccelStructBuildFlagsOverride: 0
421+
m_RayTracingAccelStructBuildFlags: 1
422+
m_SmallMeshCulling: 1
420423
m_RenderingLayerMask: 4294967295
421424
m_RendererPriority: 0
422425
m_Materials:
@@ -465,6 +468,21 @@ Transform:
465468
m_Children: []
466469
m_Father: {fileID: 0}
467470
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
471+
--- !u!114 &624999763
472+
MonoBehaviour:
473+
m_ObjectHideFlags: 0
474+
m_CorrespondingSourceObject: {fileID: 0}
475+
m_PrefabInstance: {fileID: 0}
476+
m_PrefabAsset: {fileID: 0}
477+
m_GameObject: {fileID: 624999758}
478+
m_Enabled: 1
479+
m_EditorHideFlags: 0
480+
m_Script: {fileID: 11500000, guid: 7cd0ca8b7204d4214b198040d886c542, type: 3}
481+
m_Name:
482+
m_EditorClassIdentifier:
483+
CursorEnteredName: grab
484+
CursorExitedName: default
485+
DestroyOnClick: 0
468486
--- !u!1 &1116415927
469487
GameObject:
470488
m_ObjectHideFlags: 0
@@ -871,6 +889,7 @@ GameObject:
871889
- component: {fileID: 2066011077}
872890
- component: {fileID: 2066011076}
873891
- component: {fileID: 2066011080}
892+
- component: {fileID: 2066011081}
874893
m_Layer: 0
875894
m_Name: RotatingCube
876895
m_TagString: Untagged
@@ -916,6 +935,9 @@ MeshRenderer:
916935
m_ReflectionProbeUsage: 1
917936
m_RayTracingMode: 2
918937
m_RayTraceProcedural: 0
938+
m_RayTracingAccelStructBuildFlagsOverride: 0
939+
m_RayTracingAccelStructBuildFlags: 1
940+
m_SmallMeshCulling: 1
919941
m_RenderingLayerMask: 4294967295
920942
m_RendererPriority: 0
921943
m_Materials:
@@ -980,6 +1002,21 @@ MonoBehaviour:
9801002
rotationAxis: {x: 0, y: 1, z: 0}
9811003
degreePerSecond: 90
9821004
updateType: 0
1005+
--- !u!114 &2066011081
1006+
MonoBehaviour:
1007+
m_ObjectHideFlags: 0
1008+
m_CorrespondingSourceObject: {fileID: 0}
1009+
m_PrefabInstance: {fileID: 0}
1010+
m_PrefabAsset: {fileID: 0}
1011+
m_GameObject: {fileID: 2066011075}
1012+
m_Enabled: 1
1013+
m_EditorHideFlags: 0
1014+
m_Script: {fileID: 11500000, guid: 7cd0ca8b7204d4214b198040d886c542, type: 3}
1015+
m_Name:
1016+
m_EditorClassIdentifier:
1017+
CursorEnteredName: pointer
1018+
CursorExitedName: default
1019+
DestroyOnClick: 1
9831020
--- !u!1660057539 &9223372036854775807
9841021
SceneRoots:
9851022
m_ObjectHideFlags: 0

0 commit comments

Comments
 (0)