Skip to content

Commit 09de7ee

Browse files
committed
Merge branch 'master' into 2020.3-urp
2 parents 5aacf22 + d7b17f6 commit 09de7ee

File tree

5 files changed

+50
-19
lines changed

5 files changed

+50
-19
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
TAG: ${{ steps.set_tag.outputs.VERSION }}
1616
BUILD_NAME: ${{ steps.set_build_name.outputs.VERSION }}
1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
2121
lfs: true
@@ -55,7 +55,7 @@ jobs:
5555

5656
- name: Version missmatch ❌
5757
if: ${{ !startsWith(needs.variables.outputs.TAG, needs.variables.outputs.UNITY_VERSION) }}
58-
uses: actions/github-script@v3
58+
uses: actions/github-script@v4
5959
with:
6060
script: |
6161
core.setFailed('Unity version does not match tag version')
@@ -69,7 +69,7 @@ jobs:
6969
strategy:
7070
fail-fast: false
7171
steps:
72-
- uses: actions/checkout@v3
72+
- uses: actions/checkout@v4
7373
with:
7474
fetch-depth: 0
7575
lfs: true
@@ -92,9 +92,11 @@ jobs:
9292
restore-keys: Library-201x-
9393

9494
- name: Build project
95-
uses: game-ci/unity-builder@v3
95+
uses: game-ci/unity-builder@v4
9696
env:
9797
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
98+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
99+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
98100
with:
99101
buildMethod: UnityBuilderAction.BuildScript.BuildWithCommandlineArgs
100102
customParameters: -tag ${{ needs.variables.outputs.TAG }}
@@ -136,7 +138,7 @@ jobs:
136138
runs-on: ubuntu-latest
137139
steps:
138140
- name: Checkout code
139-
uses: actions/checkout@v3
141+
uses: actions/checkout@v4
140142

141143
- uses: actions/download-artifact@v3
142144
with:

.github/workflows/upgrade-unity.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
MERGE_MASTER: ${{ inputs.mergeMaster }}
6161
CUSTOM_PARAMETERS: ${{ inputs.customParameters }}
6262

63-
- uses: actions/checkout@v3
63+
- uses: actions/checkout@v4
6464
with:
6565
fetch-depth: 0
6666
lfs: true
@@ -82,6 +82,7 @@ jobs:
8282
git fetch origin master
8383
git merge FETCH_HEAD
8484
git push
85+
git log -1
8586
8687
# Unity 2020 cache is not compatible with older versions
8788
- name: Unity Library Cache 2020 or higher
@@ -126,10 +127,11 @@ jobs:
126127
127128
- name: Build project
128129
if: ${{ !inputs.tagsOnly }}
129-
# TODO change this back to v3 once manual exit is supported there
130-
uses: game-ci/unity-builder@main
130+
uses: game-ci/unity-builder@v4
131131
env:
132132
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
133+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
134+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
133135
with:
134136
buildMethod: UnityBuilderAction.UnityPackageScripts.UpgradeAllPackagesToVerifiedVersion
135137
customParameters: ${{ inputs.customParameters }}

Assets/Scripts/Editor/BuildScript.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ public static void Build(string[] args)
135135
{
136136
PlayerSettings.SetGraphicsAPIs(BuildTarget.WebGL, new[] { GraphicsDeviceType.OpenGLES2, GraphicsDeviceType.OpenGLES3 });
137137
}
138+
139+
#if UNITY_2023_1_OR_NEWER
140+
if (tagParameters.Contains("webgl1"))
141+
{
142+
Log("WebGL1 not supported anymore, choosing WebGL2 instead");
143+
}
144+
#endif
138145
}
139146

140147
break;

Assets/Scripts/Editor/BuildScriptMenu.cs

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ public class BuildScriptMenu
2525
{
2626
"-projectPath", "",
2727
"-buildVersion", PlayerSettings.bundleVersion,
28-
"-androidVersionCode", PlayerSettings.Android.bundleVersionCode.ToString(CultureInfo.InvariantCulture)
28+
"-androidVersionCode", PlayerSettings.Android.bundleVersionCode.ToString(CultureInfo.InvariantCulture),
2929
};
3030

31+
// Unity 2023.1+ does not support webgl1 anymore
32+
#if !UNITY_2023_1_OR_NEWER
3133
[MenuItem("Tools/Build WebGL/webgl1")]
32-
public static void BuildWebGLDefault()
34+
public static void BuildWebGL1()
3335
{
3436
var parameters = new List<string>(baseParameters);
3537
string tag = $"{Application.unityVersion}-webgl1-manualBuild";
@@ -41,8 +43,8 @@ public static void BuildWebGLDefault()
4143
BuildWithParameters(parameters);
4244
}
4345

44-
[MenuItem("Tools/Build WebGL/minsize")]
45-
public static void BuildWebGLMinSize()
46+
[MenuItem("Tools/Build WebGL/minsize-webgl1")]
47+
public static void BuildWebGL1MinSize()
4648
{
4749
var parameters = new List<string>(baseParameters);
4850
string tag = $"{Application.unityVersion}-minsize-webgl1-manualBuild";
@@ -53,12 +55,13 @@ public static void BuildWebGLMinSize()
5355
SetParameterValue("-customBuildName", tag, ref parameters);
5456
BuildWithParameters(parameters);
5557
}
58+
#endif
5659

57-
[MenuItem("Tools/Build WebGL/debug")]
58-
public static void BuildWebGLDebug()
60+
[MenuItem("Tools/Build WebGL/webgl2")]
61+
public static void BuildWebGL2()
5962
{
6063
var parameters = new List<string>(baseParameters);
61-
string tag = $"{Application.unityVersion}-debug-manualBuild";
64+
string tag = $"{Application.unityVersion}-webgl2-manualBuild";
6265
SetBuildTarget(BuildTarget.WebGL, ref parameters);
6366
SetParameterValue("-autorunplayer", "true", ref parameters);
6467
SetParameterValue("-tag", tag, ref parameters);
@@ -67,11 +70,24 @@ public static void BuildWebGLDebug()
6770
BuildWithParameters(parameters);
6871
}
6972

70-
[MenuItem("Tools/Build WebGL/webgl2")]
71-
public static void BuildWebGLWebGL2()
73+
[MenuItem("Tools/Build WebGL/minsize-webgl2")]
74+
public static void BuildWebGL2MinSize()
7275
{
7376
var parameters = new List<string>(baseParameters);
74-
string tag = $"{Application.unityVersion}-webgl2-manualBuild";
77+
string tag = $"{Application.unityVersion}-minsize-webgl2-manualBuild";
78+
SetBuildTarget(BuildTarget.WebGL, ref parameters);
79+
SetParameterValue("-autorunplayer", "true", ref parameters);
80+
SetParameterValue("-tag", tag, ref parameters);
81+
SetParameterValue("-customBuildPath", $"Builds/WebGL/{tag}", ref parameters);
82+
SetParameterValue("-customBuildName", tag, ref parameters);
83+
BuildWithParameters(parameters);
84+
}
85+
86+
[MenuItem("Tools/Build WebGL/debug")]
87+
public static void BuildWebGLDebug()
88+
{
89+
var parameters = new List<string>(baseParameters);
90+
string tag = $"{Application.unityVersion}-debug-manualBuild";
7591
SetBuildTarget(BuildTarget.WebGL, ref parameters);
7692
SetParameterValue("-autorunplayer", "true", ref parameters);
7793
SetParameterValue("-tag", tag, ref parameters);

Assets/WebGLTemplates/Develop/debug-console.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ if (getCookie("addTimestamp") === "false") {
2121
addTimestamp = false;
2222
}
2323

24-
initializeToggleButton(false);
24+
const urlParams = new URLSearchParams(window.location.search);
25+
const debugParam = urlParams.get('debug');
26+
const debug = debugParam === 'true';
27+
28+
initializeToggleButton(debug);
2529
initializeDebugConsole();
2630

2731

0 commit comments

Comments
 (0)