Skip to content

Commit 4ea8995

Browse files
Update to 2022.3 LTS and batched raycasts (#5950)
* Updated to Unity 2022.3. * Added support for batched raycasting in ray perception sensor. Only for 3D (batched raycasting is only supported in 3D). * Added batched raycast tests and docs. * Updated meta file validation exclude list. * Added unity physics module dependency to core package.
1 parent 4cfe3c0 commit 4ea8995

File tree

101 files changed

+1325
-465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1325
-465
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Please wrap in triple backticks (```) to make it easier to read.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Environment (please complete the following information):**
27-
- Unity Version: [e.g. Unity 2020.1f1]
27+
- Unity Version: [e.g. Unity 2022.3f1]
2828
- OS + version: [e.g. Windows 10]
2929
- _ML-Agents version_: (e.g. ML-Agents v0.8, or latest `develop` branch from source)
3030
- _Torch version_: (you can run `pip3 show torch` to get this)

.yamato/com.unity.ml-agents-pack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pack:
99
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
1010
conda activate python3.8
1111
python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
12-
unity-downloader-cli -u 2021.3 -c editor --wait --fast
12+
unity-downloader-cli -u 2022.3 -c editor --wait --fast
1313
./.Editor/Unity -projectPath Project -batchMode -executeMethod Unity.MLAgents.SampleExporter.ExportCuratedSamples -logFile -
1414
npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
1515
upm-ci project pack --project-path Project

.yamato/com.unity.ml-agents-performance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
test_editors:
2-
- version: 2021.3
3-
- version: 2022.1
2+
- version: 2022.3
3+
- version: 2023.1
44
---
55
{% for editor in test_editors %}
66
Run_Mac_Perfomance_Tests{{ editor.version }}:

.yamato/com.unity.ml-agents-promotion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
test_editors:
2-
- version: 2021.3
2+
- version: 2022.3
33
test_platforms:
44
- name: win
55
type: Unity::VM

.yamato/com.unity.ml-agents-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{% metadata_file .yamato/coverage_tests.metafile %}
22
test_editors:
3-
- version: 2021.3
3+
- version: 2022.3
44
# We want some scene tests to run in the DevProject, but packages there only support 2020+
55
testProject: Project
66
enableNoDefaultPackages: !!bool true
7-
- version: 2022.1
7+
- version: 2023.1
88
testProject: DevProject
99
enableNoDefaultPackages: !!bool true
1010

.yamato/coverage_tests.metafile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
coverage_test_editors:
2-
- version: 2021.3
2+
- version: 2022.3
33
testProject: DevProject
44

55
coverage_test_platforms:

.yamato/standalone-build-webgl-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% capture editor_version %}2021.3{% endcapture %}
1+
{% capture editor_version %}2022.3{% endcapture %}
22
test_webgl_standalone_{{ editor_version }}:
33
name: Test WebGL Standalone {{ editor_version }}
44
agent:

.yamato/test_versions.metafile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# For each "other" test, we only run it against a single version of the
44
# editor to reduce the number of yamato jobs
55
test_editors:
6-
- version: 2021.3
6+
- version: 2022.3
77
extra_test: gym
8-
- version: 2022.1
8+
- version: 2023.1
99
extra_test: sensor
1010
- version: trunk
1111
extra_test: llapi

DevProject/Packages/manifest.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"dependencies": {
3+
"com.unity.ai.navigation": "1.1.4",
34
"com.unity.coding": "0.1.0-preview.13",
4-
"com.unity.inputsystem": "1.3.0",
5+
"com.unity.inputsystem": "1.6.1",
56
"com.unity.ml-agents": "file:../../com.unity.ml-agents",
67
"com.unity.ml-agents.extensions": "file:../../com.unity.ml-agents.extensions",
78
"com.unity.package-manager-doctools": "1.10.0-preview",
89
"com.unity.package-validation-suite": "0.23.4-preview",
9-
"com.unity.test-framework": "1.1.29",
10+
"com.unity.test-framework": "1.1.33",
1011
"com.unity.test-framework.performance": "2.2.0-preview",
11-
"com.unity.testtools.codecoverage": "1.0.0-pre.3",
12+
"com.unity.testtools.codecoverage": "1.2.4",
1213
"com.unity.modules.imageconversion": "1.0.0",
1314
"com.unity.modules.physics": "1.0.0",
1415
"com.unity.modules.physics2d": "1.0.0",

DevProject/Packages/packages-lock.json

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
{
22
"dependencies": {
3+
"com.unity.ai.navigation": {
4+
"version": "1.1.4",
5+
"depth": 0,
6+
"source": "registry",
7+
"dependencies": {
8+
"com.unity.modules.ai": "1.0.0"
9+
},
10+
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
11+
},
312
"com.unity.barracuda": {
413
"version": "3.0.0",
514
"depth": 1,
@@ -12,7 +21,7 @@
1221
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
1322
},
1423
"com.unity.burst": {
15-
"version": "1.6.6",
24+
"version": "1.8.7",
1625
"depth": 2,
1726
"source": "registry",
1827
"dependencies": {
@@ -37,7 +46,7 @@
3746
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
3847
},
3948
"com.unity.inputsystem": {
40-
"version": "1.3.0",
49+
"version": "1.6.1",
4150
"depth": 0,
4251
"source": "registry",
4352
"dependencies": {
@@ -72,14 +81,14 @@
7281
}
7382
},
7483
"com.unity.nuget.mono-cecil": {
75-
"version": "1.10.1",
84+
"version": "1.11.4",
7685
"depth": 1,
7786
"source": "registry",
7887
"dependencies": {},
7988
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
8089
},
8190
"com.unity.nuget.newtonsoft-json": {
82-
"version": "3.0.2",
91+
"version": "3.2.1",
8392
"depth": 1,
8493
"source": "registry",
8594
"dependencies": {},
@@ -106,7 +115,7 @@
106115
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
107116
},
108117
"com.unity.settings-manager": {
109-
"version": "1.0.3",
118+
"version": "2.0.1",
110119
"depth": 1,
111120
"source": "registry",
112121
"dependencies": {},
@@ -120,7 +129,7 @@
120129
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
121130
},
122131
"com.unity.test-framework": {
123-
"version": "1.1.29",
132+
"version": "1.1.33",
124133
"depth": 0,
125134
"source": "registry",
126135
"dependencies": {
@@ -141,7 +150,7 @@
141150
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
142151
},
143152
"com.unity.testtools.codecoverage": {
144-
"version": "1.0.0-pre.3",
153+
"version": "1.2.4",
145154
"depth": 0,
146155
"source": "registry",
147156
"dependencies": {
@@ -166,6 +175,12 @@
166175
},
167176
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
168177
},
178+
"com.unity.modules.ai": {
179+
"version": "1.0.0",
180+
"depth": 1,
181+
"source": "builtin",
182+
"dependencies": {}
183+
},
169184
"com.unity.modules.imageconversion": {
170185
"version": "1.0.0",
171186
"depth": 0,
@@ -206,17 +221,6 @@
206221
"version": "1.0.0",
207222
"depth": 0,
208223
"source": "builtin",
209-
"dependencies": {
210-
"com.unity.modules.ui": "1.0.0",
211-
"com.unity.modules.imgui": "1.0.0",
212-
"com.unity.modules.jsonserialize": "1.0.0",
213-
"com.unity.modules.uielementsnative": "1.0.0"
214-
}
215-
},
216-
"com.unity.modules.uielementsnative": {
217-
"version": "1.0.0",
218-
"depth": 1,
219-
"source": "builtin",
220224
"dependencies": {
221225
"com.unity.modules.ui": "1.0.0",
222226
"com.unity.modules.imgui": "1.0.0",

DevProject/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"m_Name": "Settings",
3-
"m_Path": "ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json",
42
"m_Dictionary": {
53
"m_DictionaryValues": [
64
{
@@ -20,4 +18,4 @@
2018
}
2119
]
2220
}
23-
}
21+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
m_EditorVersion: 2021.3.11f1
2-
m_EditorVersionWithRevision: 2021.3.11f1 (0a5ca18544bf)
1+
m_EditorVersion: 2022.3.4f1
2+
m_EditorVersionWithRevision: 2022.3.4f1 (35713cd46cd7)

Project/Assets/ML-Agents/Examples/PushBlockWithInput/Scripts/PushBlockActions.cs

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
4-
// version 1.3.0
4+
// version 1.6.1
55
// from Assets/ML-Agents/Examples/PushBlockWithInput/PushBlockActions.inputactions
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if
@@ -15,7 +15,7 @@
1515
using UnityEngine.InputSystem;
1616
using UnityEngine.InputSystem.Utilities;
1717

18-
public partial class @PushBlockActions : IInputActionCollection2, IDisposable
18+
public partial class @PushBlockActions: IInputActionCollection2, IDisposable
1919
{
2020
public InputActionAsset asset { get; }
2121
public @PushBlockActions()
@@ -250,20 +250,22 @@ public void Disable()
250250
{
251251
asset.Disable();
252252
}
253+
253254
public IEnumerable<InputBinding> bindings => asset.bindings;
254255

255256
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
256257
{
257258
return asset.FindAction(actionNameOrId, throwIfNotFound);
258259
}
260+
259261
public int FindBinding(InputBinding bindingMask, out InputAction action)
260262
{
261263
return asset.FindBinding(bindingMask, out action);
262264
}
263265

264266
// Movement
265267
private readonly InputActionMap m_Movement;
266-
private IMovementActions m_MovementActionsCallbackInterface;
268+
private List<IMovementActions> m_MovementActionsCallbackInterfaces = new List<IMovementActions>();
267269
private readonly InputAction m_Movement_movement;
268270
private readonly InputAction m_Movement_jump;
269271
public struct MovementActions
@@ -277,27 +279,40 @@ public struct MovementActions
277279
public void Disable() { Get().Disable(); }
278280
public bool enabled => Get().enabled;
279281
public static implicit operator InputActionMap(MovementActions set) { return set.Get(); }
282+
public void AddCallbacks(IMovementActions instance)
283+
{
284+
if (instance == null || m_Wrapper.m_MovementActionsCallbackInterfaces.Contains(instance)) return;
285+
m_Wrapper.m_MovementActionsCallbackInterfaces.Add(instance);
286+
@movement.started += instance.OnMovement;
287+
@movement.performed += instance.OnMovement;
288+
@movement.canceled += instance.OnMovement;
289+
@jump.started += instance.OnJump;
290+
@jump.performed += instance.OnJump;
291+
@jump.canceled += instance.OnJump;
292+
}
293+
294+
private void UnregisterCallbacks(IMovementActions instance)
295+
{
296+
@movement.started -= instance.OnMovement;
297+
@movement.performed -= instance.OnMovement;
298+
@movement.canceled -= instance.OnMovement;
299+
@jump.started -= instance.OnJump;
300+
@jump.performed -= instance.OnJump;
301+
@jump.canceled -= instance.OnJump;
302+
}
303+
304+
public void RemoveCallbacks(IMovementActions instance)
305+
{
306+
if (m_Wrapper.m_MovementActionsCallbackInterfaces.Remove(instance))
307+
UnregisterCallbacks(instance);
308+
}
309+
280310
public void SetCallbacks(IMovementActions instance)
281311
{
282-
if (m_Wrapper.m_MovementActionsCallbackInterface != null)
283-
{
284-
@movement.started -= m_Wrapper.m_MovementActionsCallbackInterface.OnMovement;
285-
@movement.performed -= m_Wrapper.m_MovementActionsCallbackInterface.OnMovement;
286-
@movement.canceled -= m_Wrapper.m_MovementActionsCallbackInterface.OnMovement;
287-
@jump.started -= m_Wrapper.m_MovementActionsCallbackInterface.OnJump;
288-
@jump.performed -= m_Wrapper.m_MovementActionsCallbackInterface.OnJump;
289-
@jump.canceled -= m_Wrapper.m_MovementActionsCallbackInterface.OnJump;
290-
}
291-
m_Wrapper.m_MovementActionsCallbackInterface = instance;
292-
if (instance != null)
293-
{
294-
@movement.started += instance.OnMovement;
295-
@movement.performed += instance.OnMovement;
296-
@movement.canceled += instance.OnMovement;
297-
@jump.started += instance.OnJump;
298-
@jump.performed += instance.OnJump;
299-
@jump.canceled += instance.OnJump;
300-
}
312+
foreach (var item in m_Wrapper.m_MovementActionsCallbackInterfaces)
313+
UnregisterCallbacks(item);
314+
m_Wrapper.m_MovementActionsCallbackInterfaces.Clear();
315+
AddCallbacks(instance);
301316
}
302317
}
303318
public MovementActions @Movement => new MovementActions(this);

0 commit comments

Comments
 (0)