浏览代码
Merge remote-tracking branch 'origin/master' into MLA-1734-demo-provider
/MLA-1734-demo-provider
Merge remote-tracking branch 'origin/master' into MLA-1734-demo-provider
/MLA-1734-demo-provider
Chris Elion
4 年前
当前提交
49a27695
共有 226 个文件被更改,包括 7125 次插入 和 1271 次删除
-
3.pre-commit-config.yaml
-
2.yamato/com.unity.ml-agents-test.yml
-
16DevProject/Packages/manifest.json
-
42DevProject/ProjectSettings/ProjectSettings.asset
-
4DevProject/ProjectSettings/ProjectVersion.txt
-
929Project/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldTwos.prefab
-
935Project/Assets/ML-Agents/Examples/Soccer/Prefabs/StrikersVsGoalieField.prefab
-
22Project/Assets/ML-Agents/Examples/Soccer/Scenes/SoccerTwos.unity
-
1Project/Assets/ML-Agents/Examples/Soccer/Scenes/StrikersVsGoalie.unity
-
2Project/Assets/ML-Agents/Examples/Sorter/Prefabs/Area.prefab
-
4Project/Packages/manifest.json
-
2Project/ProjectSettings/ProjectVersion.txt
-
126com.unity.ml-agents.extensions/Documentation~/Grid-Sensor.md
-
13com.unity.ml-agents.extensions/Documentation~/com.unity.ml-agents.extensions.md
-
3com.unity.ml-agents.extensions/Runtime/Unity.ML-Agents.Extensions.asmdef
-
2com.unity.ml-agents.extensions/package.json
-
4com.unity.ml-agents/CHANGELOG.md
-
8com.unity.ml-agents/Documentation~/com.unity.ml-agents.md
-
10com.unity.ml-agents/Runtime/Academy.cs
-
45com.unity.ml-agents/Runtime/Actuators/ActionSpec.cs
-
12com.unity.ml-agents/Runtime/Actuators/ActuatorManager.cs
-
10com.unity.ml-agents/Runtime/Actuators/VectorActuator.cs
-
8com.unity.ml-agents/Runtime/Agent.deprecated.cs
-
3com.unity.ml-agents/Runtime/Analytics/Events.cs
-
1com.unity.ml-agents/Runtime/AssemblyInfo.cs
-
49com.unity.ml-agents/Runtime/Communicator/RpcCommunicator.cs
-
28com.unity.ml-agents/Runtime/Policies/BehaviorParameters.cs
-
2com.unity.ml-agents/Tests/Editor/Analytics/InferenceAnalyticsTests.cs
-
46com.unity.ml-agents/Tests/Editor/BehaviorParameterTests.cs
-
12com.unity.ml-agents/Tests/Editor/ParameterLoaderTest.cs
-
4com.unity.ml-agents/package.json
-
24docs/Installation.md
-
4docs/Learning-Environment-Design-Agents.md
-
2docs/Learning-Environment-Examples.md
-
2gym-unity/gym_unity/__init__.py
-
2ml-agents-envs/mlagents_envs/__init__.py
-
8ml-agents/mlagents/plugins/stats_writer.py
-
2ml-agents/mlagents/trainers/__init__.py
-
4ml-agents/tests/yamato/standalone_build_tests.py
-
11ml-agents/tests/yamato/yamato_utils.py
-
30.yamato/standalone-build-webgl-test.yml
-
2DevProject/DevProject.sln.DotSettings
-
519DevProject/Packages/packages-lock.json
-
57com.unity.ml-agents.extensions/Documentation~/InputActuatorComponent.md
-
3com.unity.ml-agents.extensions/Editor/Input.meta
-
3com.unity.ml-agents.extensions/Runtime/Input.meta
-
3com.unity.ml-agents.extensions/Tests/Runtime/Input.meta
-
35com.unity.ml-agents/Runtime/Communicator/CommunicatorFactory.cs
-
3com.unity.ml-agents/Runtime/Communicator/CommunicatorFactory.cs.meta
-
40com.unity.ml-agents/Tests/Editor/Actuators/ActionSpecTests.cs
-
3com.unity.ml-agents/Tests/Editor/Actuators/ActionSpecTests.cs.meta
-
7DevProject/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json
-
70ML-Agents-Input-Example/.gitignore
-
33ML-Agents-Input-Example/Assets/InputSystem.inputsettings.asset
-
8ML-Agents-Input-Example/Assets/InputSystem.inputsettings.asset.meta
-
8ML-Agents-Input-Example/Assets/ML-Agents.meta
-
8ML-Agents-Input-Example/Assets/ML-Agents/Examples.meta
-
10ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock.meta
-
8ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Meshes.meta
-
1001ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Meshes/PushBlockCourt.fbx
-
120ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Meshes/PushBlockCourt.fbx.meta
-
10ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Prefabs.meta
-
1001ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockArea.prefab
-
10ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockArea.prefab.meta
-
179ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/PushBlockActions.inputactions
-
14ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/PushBlockActions.inputactions.meta
-
10ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scenes.meta
-
1001ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scenes/PushBlock.unity
-
9ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scenes/PushBlock.unity.meta
-
10ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scripts.meta
-
26ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scripts/GoalDetect.cs
-
13ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scripts/GoalDetect.cs.meta
-
192ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentBasic.cs
-
12ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentBasic.cs.meta
-
316ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scripts/PushBlockActions.cs
-
11ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scripts/PushBlockActions.cs.meta
-
112ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scripts/PushBlockPlayerController.cs
-
11ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scripts/PushBlockPlayerController.cs.meta
-
39ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scripts/PushBlockSettings.cs
-
11ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scripts/PushBlockSettings.cs.meta
-
8ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/TFModels.meta
-
1001ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlock.onnx
-
14ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlock.onnx.meta
-
8ML-Agents-Input-Example/Assets/ML-Agents/Examples/SharedAssets.meta
|
|||
m_EditorVersion: 2019.4.7f1 |
|||
m_EditorVersionWithRevision: 2019.4.7f1 (e992b1a16e65) |
|||
m_EditorVersion: 2019.4.19f1 |
|||
m_EditorVersionWithRevision: 2019.4.19f1 (ca5b14067cec) |
929
Project/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldTwos.prefab
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
935
Project/Assets/ML-Agents/Examples/Soccer/Prefabs/StrikersVsGoalieField.prefab
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
m_EditorVersion: 2018.4.24f1 |
|||
m_EditorVersion: 2018.4.32f1 |
|
|||
# Version of the library that will be used to upload to pypi |
|||
__version__ = "0.24.0.dev0" |
|||
__version__ = "0.25.0.dev0" |
|||
|
|||
# Git tag that will be checked to determine whether to trigger upload to pypi |
|||
__release_tag__ = None |
|
|||
# Version of the library that will be used to upload to pypi |
|||
__version__ = "0.24.0.dev0" |
|||
__version__ = "0.25.0.dev0" |
|||
|
|||
# Git tag that will be checked to determine whether to trigger upload to pypi |
|||
__release_tag__ = None |
|
|||
# Version of the library that will be used to upload to pypi |
|||
__version__ = "0.24.0.dev0" |
|||
__version__ = "0.25.0.dev0" |
|||
|
|||
# Git tag that will be checked to determine whether to trigger upload to pypi |
|||
__release_tag__ = None |
|
|||
{% capture editor_version %}2020.2{% endcapture %} |
|||
test_webgl_standalone_{{ editor_version }}: |
|||
name: Test WebGL Standalone {{ editor_version }} |
|||
agent: |
|||
type: Unity::VM |
|||
image: package-ci/ubuntu:stable |
|||
flavor: b1.large |
|||
variables: |
|||
UNITY_VERSION: {{ editor_version }} |
|||
commands: |
|||
- | |
|||
python3 -m venv venv && source venv/bin/activate |
|||
python -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple |
|||
python -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade |
|||
unity-downloader-cli -u {{ editor_version }} -c editor -c WebGL --wait --fast |
|||
python -u -m ml-agents.tests.yamato.standalone_build_tests --build-target=webgl |
|||
|
|||
triggers: |
|||
cancel_old_ci: true |
|||
recurring: |
|||
- branch: master |
|||
frequency: weekly |
|||
artifacts: |
|||
logs: |
|||
paths: |
|||
- "artifacts/standalone_build.txt" |
|||
standalonebuild: |
|||
paths: |
|||
- "artifacts/testPlayer*/**" |
|||
- "artifacts/**/UnityPlayer.so" |
|
|||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> |
|||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RL/@EntryIndexedValue">RL</s:String></wpf:ResourceDictionary> |
|
|||
{ |
|||
"dependencies": { |
|||
"com.unity.2d.sprite": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.2d.tilemap": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.ads": { |
|||
"version": "3.6.1", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"com.unity.ugui": "1.0.0" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.analytics": { |
|||
"version": "3.3.5", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"com.unity.ugui": "1.0.0" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.barracuda": { |
|||
"version": "1.3.0-preview", |
|||
"depth": 1, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"com.unity.burst": "1.3.4", |
|||
"com.unity.modules.jsonserialize": "1.0.0", |
|||
"com.unity.modules.imageconversion": "1.0.0" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.burst": { |
|||
"version": "1.3.4", |
|||
"depth": 2, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"com.unity.mathematics": "1.2.1" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.coding": { |
|||
"version": "0.1.0-preview.13", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"nuget.moq": "1.0.0" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.collab-proxy": { |
|||
"version": "1.2.16", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": {}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.ext.nunit": { |
|||
"version": "1.0.6", |
|||
"depth": 1, |
|||
"source": "registry", |
|||
"dependencies": {}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.ide.rider": { |
|||
"version": "1.1.4", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"com.unity.test-framework": "1.1.1" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.ide.vscode": { |
|||
"version": "1.2.3", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": {}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.inputsystem": { |
|||
"version": "1.1.0-preview.3", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": {}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.mathematics": { |
|||
"version": "1.2.1", |
|||
"depth": 3, |
|||
"source": "registry", |
|||
"dependencies": {}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.ml-agents": { |
|||
"version": "file:../../com.unity.ml-agents", |
|||
"depth": 0, |
|||
"source": "local", |
|||
"dependencies": { |
|||
"com.unity.barracuda": "1.3.0-preview", |
|||
"com.unity.modules.imageconversion": "1.0.0", |
|||
"com.unity.modules.jsonserialize": "1.0.0", |
|||
"com.unity.modules.physics": "1.0.0", |
|||
"com.unity.modules.physics2d": "1.0.0", |
|||
"com.unity.modules.unityanalytics": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.ml-agents.extensions": { |
|||
"version": "file:../../com.unity.ml-agents.extensions", |
|||
"depth": 0, |
|||
"source": "local", |
|||
"dependencies": { |
|||
"com.unity.ml-agents": "1.7.2-preview" |
|||
} |
|||
}, |
|||
"com.unity.multiplayer-hlapi": { |
|||
"version": "1.0.8", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"nuget.mono-cecil": "0.1.6-preview" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.nuget.mono-cecil": { |
|||
"version": "0.1.6-preview.2", |
|||
"depth": 1, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"nuget.mono-cecil": "0.1.6-preview" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.nuget.newtonsoft-json": { |
|||
"version": "2.0.0-preview", |
|||
"depth": 1, |
|||
"source": "registry", |
|||
"dependencies": {}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.package-manager-doctools": { |
|||
"version": "1.7.0-preview", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"com.unity.package-validation-suite": "0.10.0-preview", |
|||
"com.unity.nuget.newtonsoft-json": "2.0.0-preview" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.package-validation-suite": { |
|||
"version": "0.19.0-preview", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"com.unity.nuget.mono-cecil": "0.1.6-preview.2" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.purchasing": { |
|||
"version": "2.2.1", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"com.unity.ugui": "1.0.0" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.settings-manager": { |
|||
"version": "1.0.1", |
|||
"depth": 1, |
|||
"source": "registry", |
|||
"dependencies": {}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.test-framework": { |
|||
"version": "1.1.20", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"com.unity.ext.nunit": "1.0.6", |
|||
"com.unity.modules.imgui": "1.0.0", |
|||
"com.unity.modules.jsonserialize": "1.0.0" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.test-framework.performance": { |
|||
"version": "2.2.0-preview", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"com.unity.test-framework": "1.1.0", |
|||
"com.unity.nuget.newtonsoft-json": "2.0.0-preview" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.testtools.codecoverage": { |
|||
"version": "1.0.0-pre.3", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"com.unity.test-framework": "1.0.16", |
|||
"com.unity.settings-manager": "1.0.1" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.textmeshpro": { |
|||
"version": "2.0.1", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"com.unity.ugui": "1.0.0" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.timeline": { |
|||
"version": "1.2.12", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": {}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.ugui": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.ui": "1.0.0", |
|||
"com.unity.modules.imgui": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.xr.legacyinputhelpers": { |
|||
"version": "2.1.7", |
|||
"depth": 0, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"com.unity.modules.vr": "1.0.0", |
|||
"com.unity.modules.xr": "1.0.0" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"nuget.castle-core": { |
|||
"version": "1.0.1", |
|||
"depth": 2, |
|||
"source": "registry", |
|||
"dependencies": {}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"nuget.mono-cecil": { |
|||
"version": "0.1.6-preview", |
|||
"depth": 1, |
|||
"source": "registry", |
|||
"dependencies": {}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"nuget.moq": { |
|||
"version": "1.0.0", |
|||
"depth": 1, |
|||
"source": "registry", |
|||
"dependencies": { |
|||
"nuget.castle-core": "1.0.1" |
|||
}, |
|||
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" |
|||
}, |
|||
"com.unity.modules.ai": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.androidjni": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.animation": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.assetbundle": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.audio": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.cloth": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.physics": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.director": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.audio": "1.0.0", |
|||
"com.unity.modules.animation": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.imageconversion": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.imgui": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.jsonserialize": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.particlesystem": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.physics": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.physics2d": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.screencapture": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.imageconversion": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.subsystems": { |
|||
"version": "1.0.0", |
|||
"depth": 1, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.jsonserialize": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.terrain": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.terrainphysics": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.physics": "1.0.0", |
|||
"com.unity.modules.terrain": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.tilemap": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.physics2d": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.ui": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.uielements": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.imgui": "1.0.0", |
|||
"com.unity.modules.jsonserialize": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.umbra": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.unityanalytics": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.unitywebrequest": "1.0.0", |
|||
"com.unity.modules.jsonserialize": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.unitywebrequest": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.unitywebrequestassetbundle": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.assetbundle": "1.0.0", |
|||
"com.unity.modules.unitywebrequest": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.unitywebrequestaudio": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.unitywebrequest": "1.0.0", |
|||
"com.unity.modules.audio": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.unitywebrequesttexture": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.unitywebrequest": "1.0.0", |
|||
"com.unity.modules.imageconversion": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.unitywebrequestwww": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.unitywebrequest": "1.0.0", |
|||
"com.unity.modules.unitywebrequestassetbundle": "1.0.0", |
|||
"com.unity.modules.unitywebrequestaudio": "1.0.0", |
|||
"com.unity.modules.audio": "1.0.0", |
|||
"com.unity.modules.assetbundle": "1.0.0", |
|||
"com.unity.modules.imageconversion": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.vehicles": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.physics": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.video": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.audio": "1.0.0", |
|||
"com.unity.modules.ui": "1.0.0", |
|||
"com.unity.modules.unitywebrequest": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.vr": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.jsonserialize": "1.0.0", |
|||
"com.unity.modules.physics": "1.0.0", |
|||
"com.unity.modules.xr": "1.0.0" |
|||
} |
|||
}, |
|||
"com.unity.modules.wind": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": {} |
|||
}, |
|||
"com.unity.modules.xr": { |
|||
"version": "1.0.0", |
|||
"depth": 0, |
|||
"source": "builtin", |
|||
"dependencies": { |
|||
"com.unity.modules.physics": "1.0.0", |
|||
"com.unity.modules.jsonserialize": "1.0.0", |
|||
"com.unity.modules.subsystems": "1.0.0" |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
# Integration of the Input System Package with ML-Agents |
|||
|
|||
## Overview |
|||
One area we are always trying to improve is getting developers up and running with ML-Agents. With this in mind, |
|||
we have implemented an `InputActuatorComponent`. This component integrates with the |
|||
[Input System Package](https://docs.unity3d.com/Packages/com.unity.inputsystem@1.1/manual/QuickStartGuide.html) |
|||
to set up an action space for your `Agent` based on an `InputActionAsset` that is referenced by the |
|||
`IInputActionAssetProvider` interface, or the `PlayerInput` component that may be living on your player controlled |
|||
`Agent`. This means that if you have code outside of your agent that handles input, you will not need to implement |
|||
the Heuristic function in agent as well. The `InputActuatorComponent` will handle this for you. You can now train and |
|||
run inference on `Agents` with an action space defined by an `InputActionAsset`. |
|||
|
|||
This implementation includes: |
|||
|
|||
* C# `InputActuatorComponent` you can attach to your Agent. |
|||
* Implement the `IInputActionAssetProvider` in the `Componenet` where you handle player input. |
|||
* An example environment where the input handling code is not in the Heuristic function of the Agent subclass. |
|||
|
|||
### Feedback |
|||
We have only implemented a small subset of `InputControl` types that we thought would cover a large portion of what |
|||
most developers would use. Please let us know if you want more control types implemented by posting in the [ML-Agents |
|||
forum.](https://forum.unity.com/forums/ml-agents.453/) |
|||
|
|||
We would also like your feedback on the workflow of integrating this into your games. If you run |
|||
into workflow issues please let us know in the ML-Agents forums, or if you've discovered a bug, |
|||
please file a bug on our GitHub page. |
|||
|
|||
## Getting started |
|||
The C# code for the `InputActuatorComponent` exists inside of the extensions package (com.unity.ml-agents.extensions). A good first step would be to familiarize with the extensions package by reading the document [here](com.unity.ml-agents.extensions.md). The second step would be to take a look at how we have implemented the C# code in the example Input Integration scene (located under ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/). Once you have some familiarity, then the next step would be to add the InputActuatorComponent to your player Agent. The example we have implemented uses C# Events to send information from the Input System. |
|||
|
|||
Additionally, see below for additional technical specifications on the C# code for the InputActuatorComponent. |
|||
|
|||
## Technical specifications for the InputActuatorComponent |
|||
|
|||
### `IInputActionsAssetProvider` Interface |
|||
The `InputActuatorComponent` searches for a `Component` that implements |
|||
`IInputActionAssetProvider` on the `GameObject` they both are attached to. It is important to note |
|||
that if multiple `Components` on your `GameObject` need to access an `InputActionAsset` to handle events, |
|||
they will need to share the same instance of the `InputActionAsset` that is returned from the |
|||
`IInputActionAssetProvider`. |
|||
|
|||
### `InputActuatorComponent` class |
|||
The `InputActuatorComponent` is the bridge between ML-Agents and the Input System.. It allows ML-Agents to |
|||
* create an `ActionSpec` for your Agent based on an `InputActionAsset` that comes from an |
|||
`IInputActionAssetProvider`. |
|||
* send simulated input from a training process or a neural network |
|||
* let developers keep their input handling code in one place |
|||
|
|||
This is accomplished by adding the `InputActuatorComponenet` to an Agent which already has the PlayerInput component attached. |
|||
|
|||
### Setting up a scene using the `InputActuatorComponent` |
|||
1. Add the `com.unity.inputsystem` version 1.1.0-preview.3 or later to your project via the Package Manager window. |
|||
2. If you have already setup an InputActionAsset skip to Step 3, otherwise follow these sub steps: |
|||
1. Create an InputActionAsset to allow your Agent to be controlled by the Input System. |
|||
2. Handle the events from the Input System where you normally would (i.e. a script external to your Agent class). |
|||
3. Add the InputSystemActuatorComponent to the GameObject that has the `PlayerInput` and `Agent` components attached. |
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 1f773a20e85042999e87f5d3c7b55281 |
|||
timeCreated: 1613637190 |
|
|||
fileFormatVersion: 2 |
|||
guid: 1694e881b9ec420ba1c201f0612392d6 |
|||
timeCreated: 1610754907 |
|
|||
fileFormatVersion: 2 |
|||
guid: 27f8e1ce37d7485f814ce50a37101203 |
|||
timeCreated: 1612908869 |
|
|||
namespace Unity.MLAgents |
|||
{ |
|||
/// <summary>
|
|||
/// Factory class for an ICommunicator instance. This is used to the <see cref="Academy"/> at startup.
|
|||
/// By default, on desktop platforms, an ICommunicator will be created and attempt to connect
|
|||
/// to a trainer. This behavior can be prevented by setting <see cref="CommunicatorFactory.Enabled"/> to false
|
|||
/// *before* the <see cref="Academy"/> is initialized.
|
|||
/// </summary>
|
|||
public static class CommunicatorFactory |
|||
{ |
|||
static bool s_Enabled = true; |
|||
|
|||
/// <summary>
|
|||
/// Whether or not an ICommunicator instance will be created when the <see cref="Academy"/> is initialized.
|
|||
/// Changing this has no effect after the <see cref="Academy"/> has already been initialized.
|
|||
/// </summary>
|
|||
public static bool Enabled |
|||
{ |
|||
get => s_Enabled; |
|||
set => s_Enabled = value; |
|||
} |
|||
|
|||
internal static ICommunicator Create() |
|||
{ |
|||
#if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX
|
|||
if (s_Enabled) |
|||
{ |
|||
return new RpcCommunicator(); |
|||
} |
|||
#endif
|
|||
// Non-desktop or disabled
|
|||
return null; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 0b604cddc07e4484a2cdaba630a971ea |
|||
timeCreated: 1613617949 |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using NUnit.Framework; |
|||
using Unity.MLAgents.Actuators; |
|||
using UnityEngine.TestTools.Constraints; |
|||
using Is = UnityEngine.TestTools.Constraints.Is; |
|||
|
|||
namespace Unity.MLAgents.Tests.Actuators |
|||
{ |
|||
[TestFixture] |
|||
public class ActionSpecTests |
|||
{ |
|||
[Test] |
|||
public void ActionSpecCombineTest() |
|||
{ |
|||
var as0 = new ActionSpec(3, new[] { 3, 2, 1 }); |
|||
var as1 = new ActionSpec(1, new[] { 35, 122, 1, 3, 8, 3 }); |
|||
|
|||
var as0NumCon = 3; |
|||
var as0NumDis = as0.NumDiscreteActions; |
|||
var as1NumCon = 1; |
|||
var as1NumDis = as1.NumDiscreteActions; |
|||
var branchSizes = new List<int>(); |
|||
branchSizes.AddRange(as0.BranchSizes); |
|||
branchSizes.AddRange(as1.BranchSizes); |
|||
|
|||
var asc = ActionSpec.Combine(as0, as1); |
|||
|
|||
Assert.AreEqual(as0NumCon + as1NumCon, asc.NumContinuousActions); |
|||
Assert.AreEqual(as0NumDis + as1NumDis, asc.NumDiscreteActions); |
|||
Assert.IsTrue(branchSizes.ToArray().SequenceEqual(asc.BranchSizes)); |
|||
|
|||
as0 = new ActionSpec(3); |
|||
as1 = new ActionSpec(1); |
|||
asc = ActionSpec.Combine(as0, as1); |
|||
Assert.IsEmpty(asc.BranchSizes); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 99d76ec04c944b75bc6b85abfff4ac4e |
|||
timeCreated: 1613680505 |
|
|||
{ |
|||
"m_Name": "Settings", |
|||
"m_Path": "ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json", |
|||
"m_Dictionary": { |
|||
"m_DictionaryValues": [] |
|||
} |
|||
} |
|
|||
/[Ll]ibrary/ |
|||
/Logs/ |
|||
/[Tt]emp/ |
|||
/[Oo]bj/ |
|||
/[Bb]uild/ |
|||
/[Bb]uilds/ |
|||
/Assets/AssetStoreTools* |
|||
/Assets/Plugins* |
|||
/Assets/Demonstrations* |
|||
/Assets/ML-Agents/Timers* |
|||
/*_timers.json |
|||
|
|||
# Environemnt logfile |
|||
*Project.log |
|||
|
|||
# Visual Studio 2015 cache directory |
|||
/.vs/ |
|||
|
|||
# Autogenerated VS/MD/Consulo solution and project files |
|||
/ProjectExportedObj/ |
|||
/Project.consulo/ |
|||
*.csproj |
|||
*.unityproj |
|||
*.sln |
|||
*.suo |
|||
*.tmp |
|||
*.user |
|||
*.userprefs |
|||
*.pidb |
|||
*.booproj |
|||
*.svd |
|||
*.pdb |
|||
|
|||
# Unity3D generated meta files |
|||
*.pidb.meta |
|||
|
|||
# Unity3D Generated File On Crash Reports |
|||
/sysinfo.txt |
|||
|
|||
# Builds |
|||
*.apk |
|||
*.unitypackage |
|||
*.app |
|||
*.exe |
|||
*.x86_64 |
|||
*.x86 |
|||
|
|||
# Plugins |
|||
/Assets/VideoRecorder* |
|||
|
|||
# Mac hidden files |
|||
*.DS_Store |
|||
*/.ipynb_checkpoints |
|||
*/.idea |
|||
*.pyc |
|||
*.idea/misc.xml |
|||
*.idea/modules.xml |
|||
*.idea/ |
|||
*.iml |
|||
*.cache |
|||
*/build/ |
|||
*/dist/ |
|||
*.egg-info* |
|||
*.eggs* |
|||
*.gitignore.swp |
|||
|
|||
# VSCode hidden files |
|||
*.vscode/ |
|||
|
|||
.DS_Store |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: c46f07b5ed07e4e92aa78254188d3d10, type: 3} |
|||
m_Name: InputSystem.inputsettings |
|||
m_EditorClassIdentifier: |
|||
m_SupportedDevices: |
|||
- Keyboard |
|||
- Gamepad |
|||
m_UpdateMode: 2 |
|||
m_CompensateForScreenOrientation: 0 |
|||
m_FilterNoiseOnCurrent: 0 |
|||
m_DefaultDeadzoneMin: 0.125 |
|||
m_DefaultDeadzoneMax: 0.925 |
|||
m_DefaultButtonPressPoint: 0.5 |
|||
m_ButtonReleaseThreshold: 0.75 |
|||
m_DefaultTapTime: 0.2 |
|||
m_DefaultSlowTapTime: 0.5 |
|||
m_DefaultHoldTime: 0.4 |
|||
m_TapRadius: 5 |
|||
m_MultiTapDelayTime: 0.75 |
|||
m_iOSSettings: |
|||
m_MotionUsage: |
|||
m_Enabled: 0 |
|||
m_Description: |
|
|||
fileFormatVersion: 2 |
|||
guid: 778a63fac82734ee1b70a0b7c3e975c0 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 11630fa83cc8b4194b94352e3e6cdb9d |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 6584f096f53dc43eeb32803b91f36c5c |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 4197ece8ca6d74a00adc6bafbabda158 |
|||
folderAsset: yes |
|||
timeCreated: 1506303336 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: e806d68316eff0e46a3fda372ae42c44 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Meshes/PushBlockCourt.fbx
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: c639386c12f5f7841892163a199dfacc |
|||
ModelImporter: |
|||
serializedVersion: 22 |
|||
fileIDToRecycleName: |
|||
100000: GoalArea |
|||
100002: Ground |
|||
100004: //RootNode |
|||
100006: WallsOuter |
|||
400000: GoalArea |
|||
400002: Ground |
|||
400004: //RootNode |
|||
400006: WallsOuter |
|||
2100000: rep_WhiteWalls |
|||
2100002: rep_Floor |
|||
2100004: rep_Checkers |
|||
2300000: GoalArea |
|||
2300002: Ground |
|||
2300004: WallsOuter |
|||
3300000: GoalArea |
|||
3300002: Ground |
|||
3300004: WallsOuter |
|||
4300000: WallsOuter |
|||
4300002: Ground |
|||
4300004: GoalArea |
|||
externalObjects: |
|||
- first: |
|||
type: UnityEngine:Material |
|||
assembly: UnityEngine.CoreModule |
|||
name: rep_Checkers |
|||
second: {fileID: 2100000, guid: 36c7baa347d68f347a9aa9698aa1bcdd, type: 2} |
|||
- first: |
|||
type: UnityEngine:Material |
|||
assembly: UnityEngine.CoreModule |
|||
name: rep_Floor |
|||
second: {fileID: 2100000, guid: bc723809e6ff3174fad3e774cae1aed0, type: 2} |
|||
- first: |
|||
type: UnityEngine:Material |
|||
assembly: UnityEngine.CoreModule |
|||
name: rep_WhiteWalls |
|||
second: {fileID: 2100000, guid: 6a39c0407dd85684384bf0277294e9b6, type: 2} |
|||
materials: |
|||
importMaterials: 1 |
|||
materialName: 0 |
|||
materialSearch: 1 |
|||
materialLocation: 1 |
|||
animations: |
|||
legacyGenerateAnimations: 4 |
|||
bakeSimulation: 0 |
|||
resampleCurves: 1 |
|||
optimizeGameObjects: 0 |
|||
motionNodeName: |
|||
rigImportErrors: |
|||
rigImportWarnings: |
|||
animationImportErrors: |
|||
animationImportWarnings: |
|||
animationRetargetingWarnings: |
|||
animationDoRetargetingWarnings: 0 |
|||
importAnimatedCustomProperties: 0 |
|||
animationCompression: 1 |
|||
animationRotationError: 0.5 |
|||
animationPositionError: 0.5 |
|||
animationScaleError: 0.5 |
|||
animationWrapMode: 0 |
|||
extraExposedTransformPaths: [] |
|||
extraUserProperties: [] |
|||
clipAnimations: [] |
|||
isReadable: 1 |
|||
meshes: |
|||
lODScreenPercentages: [] |
|||
globalScale: 1 |
|||
meshCompression: 0 |
|||
addColliders: 0 |
|||
importVisibility: 1 |
|||
importBlendShapes: 1 |
|||
importCameras: 1 |
|||
importLights: 1 |
|||
swapUVChannels: 0 |
|||
generateSecondaryUV: 1 |
|||
useFileUnits: 1 |
|||
optimizeMeshForGPU: 1 |
|||
keepQuads: 0 |
|||
weldVertices: 1 |
|||
preserveHierarchy: 0 |
|||
indexFormat: 0 |
|||
secondaryUVAngleDistortion: 8 |
|||
secondaryUVAreaDistortion: 15.000001 |
|||
secondaryUVHardAngle: 88 |
|||
secondaryUVPackMargin: 4 |
|||
useFileScale: 1 |
|||
tangentSpace: |
|||
normalSmoothAngle: 60 |
|||
normalImportMode: 0 |
|||
tangentImportMode: 3 |
|||
normalCalculationMode: 4 |
|||
importAnimation: 1 |
|||
copyAvatar: 0 |
|||
humanDescription: |
|||
serializedVersion: 2 |
|||
human: [] |
|||
skeleton: [] |
|||
armTwist: 0.5 |
|||
foreArmTwist: 0.5 |
|||
upperLegTwist: 0.5 |
|||
legTwist: 0.5 |
|||
armStretch: 0.05 |
|||
legStretch: 0.05 |
|||
feetSpacing: 0 |
|||
rootMotionBoneName: |
|||
rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} |
|||
hasTranslationDoF: 0 |
|||
hasExtraRoot: 0 |
|||
skeletonHasParents: 1 |
|||
lastHumanDescriptionAvatarSource: {instanceID: 0} |
|||
animationType: 0 |
|||
humanoidOversampling: 1 |
|||
additionalBone: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 3d2b9d5547d934200a786212743850c4 |
|||
folderAsset: yes |
|||
timeCreated: 1514922259 |
|||
licenseType: Free |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockArea.prefab
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 03bcc81e249714a22bb411dddcc5d15e |
|||
timeCreated: 1515023875 |
|||
licenseType: Free |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 100100000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
{ |
|||
"name": "PushBlockActions", |
|||
"maps": [ |
|||
{ |
|||
"name": "Movement", |
|||
"id": "03a2e5d4-ae81-47f1-a575-0779fb7da538", |
|||
"actions": [ |
|||
{ |
|||
"name": "movement", |
|||
"type": "Value", |
|||
"id": "5f47cbc6-de46-4d33-93e2-2b1af4f5996d", |
|||
"expectedControlType": "Vector2", |
|||
"processors": "", |
|||
"interactions": "" |
|||
}, |
|||
{ |
|||
"name": "jump", |
|||
"type": "Button", |
|||
"id": "ca5eb833-5dfb-4b7c-880d-6118bd5d1378", |
|||
"expectedControlType": "Button", |
|||
"processors": "", |
|||
"interactions": "" |
|||
} |
|||
], |
|||
"bindings": [ |
|||
{ |
|||
"name": "gamepad_move", |
|||
"id": "477500ef-6d32-4b84-b9f8-158f18bcb906", |
|||
"path": "2DVector", |
|||
"interactions": "", |
|||
"processors": "", |
|||
"groups": "", |
|||
"action": "movement", |
|||
"isComposite": true, |
|||
"isPartOfComposite": false |
|||
}, |
|||
{ |
|||
"name": "up", |
|||
"id": "6d2537b8-2266-4a50-8575-fb0fe310daa5", |
|||
"path": "<Gamepad>/dpad/up", |
|||
"interactions": "", |
|||
"processors": "", |
|||
"groups": "Keyboard", |
|||
"action": "movement", |
|||
"isComposite": false, |
|||
"isPartOfComposite": true |
|||
}, |
|||
{ |
|||
"name": "down", |
|||
"id": "50584c83-beb6-4e90-a453-a635c03a761e", |
|||
"path": "<Gamepad>/dpad/down", |
|||
"interactions": "", |
|||
"processors": "", |
|||
"groups": "Keyboard", |
|||
"action": "movement", |
|||
"isComposite": false, |
|||
"isPartOfComposite": true |
|||
}, |
|||
{ |
|||
"name": "left", |
|||
"id": "44408b8f-27e7-4c6d-b078-7536ba020d1a", |
|||
"path": "<Gamepad>/dpad/left", |
|||
"interactions": "", |
|||
"processors": "", |
|||
"groups": "Keyboard", |
|||
"action": "movement", |
|||
"isComposite": false, |
|||
"isPartOfComposite": true |
|||
}, |
|||
{ |
|||
"name": "right", |
|||
"id": "f5681423-d3e3-41a5-b85e-0a7642c774aa", |
|||
"path": "<Gamepad>/dpad/right", |
|||
"interactions": "", |
|||
"processors": "", |
|||
"groups": "Keyboard", |
|||
"action": "movement", |
|||
"isComposite": false, |
|||
"isPartOfComposite": true |
|||
}, |
|||
{ |
|||
"name": "keyboard_move", |
|||
"id": "6bcba4bf-5ce0-4005-9e6a-0de2487211b0", |
|||
"path": "2DVector", |
|||
"interactions": "", |
|||
"processors": "", |
|||
"groups": "", |
|||
"action": "movement", |
|||
"isComposite": true, |
|||
"isPartOfComposite": false |
|||
}, |
|||
{ |
|||
"name": "up", |
|||
"id": "63da699e-b354-4e63-b0f8-26fb92abea41", |
|||
"path": "<Keyboard>/w", |
|||
"interactions": "", |
|||
"processors": "", |
|||
"groups": "Keyboard", |
|||
"action": "movement", |
|||
"isComposite": false, |
|||
"isPartOfComposite": true |
|||
}, |
|||
{ |
|||
"name": "down", |
|||
"id": "39409748-9002-4aff-9a09-cdc05b9708ad", |
|||
"path": "<Keyboard>/s", |
|||
"interactions": "", |
|||
"processors": "", |
|||
"groups": "Keyboard", |
|||
"action": "movement", |
|||
"isComposite": false, |
|||
"isPartOfComposite": true |
|||
}, |
|||
{ |
|||
"name": "left", |
|||
"id": "0afe45fc-dc45-4310-9c73-7dc3c503addf", |
|||
"path": "<Keyboard>/a", |
|||
"interactions": "", |
|||
"processors": "", |
|||
"groups": "Keyboard", |
|||
"action": "movement", |
|||
"isComposite": false, |
|||
"isPartOfComposite": true |
|||
}, |
|||
{ |
|||
"name": "right", |
|||
"id": "69fe0335-9e0c-495d-a90d-4b0fcbfd2b34", |
|||
"path": "<Keyboard>/d", |
|||
"interactions": "", |
|||
"processors": "", |
|||
"groups": "Keyboard", |
|||
"action": "movement", |
|||
"isComposite": false, |
|||
"isPartOfComposite": true |
|||
}, |
|||
{ |
|||
"name": "", |
|||
"id": "ab696218-63cd-4eb8-9fe1-48a68e32e92f", |
|||
"path": "<Keyboard>/space", |
|||
"interactions": "", |
|||
"processors": "", |
|||
"groups": "Keyboard", |
|||
"action": "jump", |
|||
"isComposite": false, |
|||
"isPartOfComposite": false |
|||
}, |
|||
{ |
|||
"name": "", |
|||
"id": "7adcb138-5175-4cc4-addc-d2b02cb5f0de", |
|||
"path": "<Gamepad>/buttonSouth", |
|||
"interactions": "", |
|||
"processors": "", |
|||
"groups": "Keyboard", |
|||
"action": "jump", |
|||
"isComposite": false, |
|||
"isPartOfComposite": false |
|||
} |
|||
] |
|||
} |
|||
], |
|||
"controlSchemes": [ |
|||
{ |
|||
"name": "Keyboard", |
|||
"bindingGroup": "Keyboard", |
|||
"devices": [ |
|||
{ |
|||
"devicePath": "<Keyboard>", |
|||
"isOptional": true, |
|||
"isOR": false |
|||
}, |
|||
{ |
|||
"devicePath": "<Gamepad>", |
|||
"isOptional": true, |
|||
"isOR": false |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: fcfa5a3b2c4254b2baad1ae474fc4b93 |
|||
ScriptedImporter: |
|||
internalIDToNameTable: [] |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} |
|||
generateWrapperCode: 1 |
|||
wrapperCodePath: Assets/ML-Agents/Examples/PushBlock/Scripts/PushBlockActions.cs |
|||
wrapperClassName: |
|||
wrapperCodeNamespace: |
|
|||
fileFormatVersion: 2 |
|||
guid: 9da26ec059778432080bf5fa24374960 |
|||
folderAsset: yes |
|||
timeCreated: 1516234013 |
|||
licenseType: Free |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/Scenes/PushBlock.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: ae8cc75939e3e4d07a79c8c6a08b54f4 |
|||
timeCreated: 1506808980 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: ca44e3d53154a4ff0a1279be30b23bdf |
|||
folderAsset: yes |
|||
timeCreated: 1514922284 |
|||
licenseType: Free |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
//Detect when the orange block has touched the goal.
|
|||
//Detect when the orange block has touched an obstacle.
|
|||
//Put this script onto the orange block. There's nothing you need to set in the editor.
|
|||
//Make sure the goal is tagged with "goal" in the editor.
|
|||
|
|||
using UnityEngine; |
|||
|
|||
public class GoalDetect : MonoBehaviour |
|||
{ |
|||
/// <summary>
|
|||
/// The associated agent.
|
|||
/// This will be set by the agent script on Initialization.
|
|||
/// Don't need to manually set.
|
|||
/// </summary>
|
|||
[HideInInspector] |
|||
public PushAgentBasic agent; //
|
|||
|
|||
void OnCollisionEnter(Collision col) |
|||
{ |
|||
// Touched goal.
|
|||
if (col.gameObject.CompareTag("goal")) |
|||
{ |
|||
agent.ScoredAGoal(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 7d079d09ceed84ff49cf6841c66cf7ec |
|||
timeCreated: 1513645763 |
|||
licenseType: Free |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
//Put this script on your blue cube.
|
|||
|
|||
using System; |
|||
using System.Collections; |
|||
using UnityEngine; |
|||
using Unity.MLAgents; |
|||
using Unity.MLAgents.Actuators; |
|||
using Random = UnityEngine.Random; |
|||
|
|||
public class PushAgentBasic : Agent |
|||
{ |
|||
/// <summary>
|
|||
/// The ground. The bounds are used to spawn the elements.
|
|||
/// </summary>
|
|||
public GameObject ground; |
|||
|
|||
public GameObject area; |
|||
|
|||
/// <summary>
|
|||
/// The area bounds.
|
|||
/// </summary>
|
|||
[HideInInspector] |
|||
public Bounds areaBounds; |
|||
|
|||
PushBlockSettings m_PushBlockSettings; |
|||
|
|||
/// <summary>
|
|||
/// The block to be pushed to the goal.
|
|||
/// </summary>
|
|||
public GameObject block; |
|||
|
|||
/// <summary>
|
|||
/// Detects when the block touches the goal.
|
|||
/// </summary>
|
|||
[HideInInspector] |
|||
public GoalDetect goalDetect; |
|||
|
|||
Rigidbody m_BlockRb; //cached on initialization
|
|||
Rigidbody m_AgentRb; //cached on initialization
|
|||
Material m_GroundMaterial; //cached on Awake()
|
|||
|
|||
/// <summary>
|
|||
/// We will be changing the ground material based on success/failue
|
|||
/// </summary>
|
|||
Renderer m_GroundRenderer; |
|||
|
|||
EnvironmentParameters m_ResetParams; |
|||
|
|||
void Awake() |
|||
{ |
|||
m_PushBlockSettings = FindObjectOfType<PushBlockSettings>(); |
|||
|
|||
goalDetect = block.GetComponent<GoalDetect>(); |
|||
goalDetect.agent = this; |
|||
|
|||
// Cache the agent rigidbody
|
|||
m_AgentRb = GetComponent<Rigidbody>(); |
|||
// Cache the block rigidbody
|
|||
m_BlockRb = block.GetComponent<Rigidbody>(); |
|||
// Get the ground's bounds
|
|||
areaBounds = ground.GetComponent<Collider>().bounds; |
|||
// Get the ground renderer so we can change the material when a goal is scored
|
|||
m_GroundRenderer = ground.GetComponent<Renderer>(); |
|||
// Starting material
|
|||
m_GroundMaterial = m_GroundRenderer.material; |
|||
} |
|||
|
|||
public override void Initialize() |
|||
{ |
|||
m_ResetParams = Academy.Instance.EnvironmentParameters; |
|||
|
|||
SetResetParameters(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Use the ground's bounds to pick a random spawn position.
|
|||
/// </summary>
|
|||
public Vector3 GetRandomSpawnPos() |
|||
{ |
|||
var foundNewSpawnLocation = false; |
|||
var randomSpawnPos = Vector3.zero; |
|||
var tries = 0; |
|||
while (foundNewSpawnLocation == false && tries < 50) |
|||
{ |
|||
var randomPosX = Random.Range(-areaBounds.extents.x * m_PushBlockSettings.spawnAreaMarginMultiplier, |
|||
areaBounds.extents.x * m_PushBlockSettings.spawnAreaMarginMultiplier); |
|||
|
|||
var randomPosZ = Random.Range(-areaBounds.extents.z * m_PushBlockSettings.spawnAreaMarginMultiplier, |
|||
areaBounds.extents.z * m_PushBlockSettings.spawnAreaMarginMultiplier); |
|||
randomSpawnPos = ground.transform.position + new Vector3(randomPosX, 1f, randomPosZ); |
|||
if (Physics.CheckBox(randomSpawnPos, new Vector3(2.5f, 0.01f, 2.5f)) == false) |
|||
{ |
|||
foundNewSpawnLocation = true; |
|||
} |
|||
tries++; |
|||
} |
|||
return randomSpawnPos; |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// Called when the agent moves the block into the goal.
|
|||
/// </summary>
|
|||
public void ScoredAGoal() |
|||
{ |
|||
// We use a reward of 5.
|
|||
AddReward(5f); |
|||
|
|||
// By marking an agent as done AgentReset() will be called automatically.
|
|||
EndEpisode(); |
|||
|
|||
// Swap ground material for a bit to indicate we scored.
|
|||
StartCoroutine(GoalScoredSwapGroundMaterial(m_PushBlockSettings.goalScoredMaterial, 0.5f)); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Swap ground material, wait time seconds, then swap back to the regular material.
|
|||
/// </summary>
|
|||
IEnumerator GoalScoredSwapGroundMaterial(Material mat, float time) |
|||
{ |
|||
m_GroundRenderer.material = mat; |
|||
yield return new WaitForSeconds(time); // Wait for 2 sec
|
|||
m_GroundRenderer.material = m_GroundMaterial; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Called every step of the engine. Here the agent takes an action.
|
|||
/// </summary>
|
|||
public override void OnActionReceived(ActionBuffers actionBuffers) |
|||
{ |
|||
// Penalty given each step to encourage agent to finish task quickly.
|
|||
AddReward(-1f / MaxStep); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Resets the block position and velocities.
|
|||
/// </summary>
|
|||
void ResetBlock() |
|||
{ |
|||
// Get a random position for the block.
|
|||
block.transform.position = GetRandomSpawnPos(); |
|||
|
|||
// Reset block velocity back to zero.
|
|||
m_BlockRb.velocity = Vector3.zero; |
|||
|
|||
// Reset block angularVelocity back to zero.
|
|||
m_BlockRb.angularVelocity = Vector3.zero; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// In the editor, if "Reset On Done" is checked then AgentReset() will be
|
|||
/// called automatically anytime we mark done = true in an agent script.
|
|||
/// </summary>
|
|||
public override void OnEpisodeBegin() |
|||
{ |
|||
var rotation = Random.Range(0, 4); |
|||
var rotationAngle = rotation * 90f; |
|||
area.transform.Rotate(new Vector3(0f, rotationAngle, 0f)); |
|||
|
|||
ResetBlock(); |
|||
transform.position = GetRandomSpawnPos(); |
|||
m_AgentRb.velocity = Vector3.zero; |
|||
m_AgentRb.angularVelocity = Vector3.zero; |
|||
|
|||
SetResetParameters(); |
|||
} |
|||
|
|||
public void SetGroundMaterialFriction() |
|||
{ |
|||
var groundCollider = ground.GetComponent<Collider>(); |
|||
|
|||
groundCollider.material.dynamicFriction = m_ResetParams.GetWithDefault("dynamic_friction", 0); |
|||
groundCollider.material.staticFriction = m_ResetParams.GetWithDefault("static_friction", 0); |
|||
} |
|||
|
|||
public void SetBlockProperties() |
|||
{ |
|||
var scale = m_ResetParams.GetWithDefault("block_scale", 2); |
|||
//Set the scale of the block
|
|||
m_BlockRb.transform.localScale = new Vector3(scale, 0.75f, scale); |
|||
|
|||
// Set the drag of the block
|
|||
m_BlockRb.drag = m_ResetParams.GetWithDefault("block_drag", 0.5f); |
|||
} |
|||
|
|||
void SetResetParameters() |
|||
{ |
|||
SetGroundMaterialFriction(); |
|||
SetBlockProperties(); |
|||
} |
|||
|
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: dea8c4f2604b947e6b7b97750dde87ca |
|||
timeCreated: 1506829537 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
//------------------------------------------------------------------------------
|
|||
// <auto-generated>
|
|||
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
|||
// version 1.1.0
|
|||
// from Assets/ML-Agents/Examples/PushBlock/PushBlockActions.inputactions
|
|||
//
|
|||
// Changes to this file may cause incorrect behavior and will be lost if
|
|||
// the code is regenerated.
|
|||
// </auto-generated>
|
|||
//------------------------------------------------------------------------------
|
|||
|
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine.InputSystem; |
|||
using UnityEngine.InputSystem.Utilities; |
|||
|
|||
public partial class @PushBlockActions : IInputActionCollection2, IDisposable |
|||
{ |
|||
public InputActionAsset asset { get; } |
|||
public @PushBlockActions() |
|||
{ |
|||
asset = InputActionAsset.FromJson(@"{
|
|||
""name"": ""PushBlockActions"", |
|||
""maps"": [ |
|||
{ |
|||
""name"": ""Movement"", |
|||
""id"": ""03a2e5d4-ae81-47f1-a575-0779fb7da538"", |
|||
""actions"": [ |
|||
{ |
|||
""name"": ""movement"", |
|||
""type"": ""Value"", |
|||
""id"": ""5f47cbc6-de46-4d33-93e2-2b1af4f5996d"", |
|||
""expectedControlType"": ""Vector2"", |
|||
""processors"": """", |
|||
""interactions"": """" |
|||
}, |
|||
{ |
|||
""name"": ""jump"", |
|||
""type"": ""Button"", |
|||
""id"": ""ca5eb833-5dfb-4b7c-880d-6118bd5d1378"", |
|||
""expectedControlType"": ""Button"", |
|||
""processors"": """", |
|||
""interactions"": """" |
|||
} |
|||
], |
|||
""bindings"": [ |
|||
{ |
|||
""name"": ""gamepad_move"", |
|||
""id"": ""477500ef-6d32-4b84-b9f8-158f18bcb906"", |
|||
""path"": ""2DVector"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": """", |
|||
""action"": ""movement"", |
|||
""isComposite"": true, |
|||
""isPartOfComposite"": false |
|||
}, |
|||
{ |
|||
""name"": ""up"", |
|||
""id"": ""6d2537b8-2266-4a50-8575-fb0fe310daa5"", |
|||
""path"": ""<Gamepad>/dpad/up"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""action"": ""movement"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": true |
|||
}, |
|||
{ |
|||
""name"": ""down"", |
|||
""id"": ""50584c83-beb6-4e90-a453-a635c03a761e"", |
|||
""path"": ""<Gamepad>/dpad/down"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""action"": ""movement"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": true |
|||
}, |
|||
{ |
|||
""name"": ""left"", |
|||
""id"": ""44408b8f-27e7-4c6d-b078-7536ba020d1a"", |
|||
""path"": ""<Gamepad>/dpad/left"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""action"": ""movement"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": true |
|||
}, |
|||
{ |
|||
""name"": ""right"", |
|||
""id"": ""f5681423-d3e3-41a5-b85e-0a7642c774aa"", |
|||
""path"": ""<Gamepad>/dpad/right"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""action"": ""movement"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": true |
|||
}, |
|||
{ |
|||
""name"": ""keyboard_move"", |
|||
""id"": ""6bcba4bf-5ce0-4005-9e6a-0de2487211b0"", |
|||
""path"": ""2DVector"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": """", |
|||
""action"": ""movement"", |
|||
""isComposite"": true, |
|||
""isPartOfComposite"": false |
|||
}, |
|||
{ |
|||
""name"": ""up"", |
|||
""id"": ""63da699e-b354-4e63-b0f8-26fb92abea41"", |
|||
""path"": ""<Keyboard>/w"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""action"": ""movement"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": true |
|||
}, |
|||
{ |
|||
""name"": ""down"", |
|||
""id"": ""39409748-9002-4aff-9a09-cdc05b9708ad"", |
|||
""path"": ""<Keyboard>/s"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""action"": ""movement"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": true |
|||
}, |
|||
{ |
|||
""name"": ""left"", |
|||
""id"": ""0afe45fc-dc45-4310-9c73-7dc3c503addf"", |
|||
""path"": ""<Keyboard>/a"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""action"": ""movement"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": true |
|||
}, |
|||
{ |
|||
""name"": ""right"", |
|||
""id"": ""69fe0335-9e0c-495d-a90d-4b0fcbfd2b34"", |
|||
""path"": ""<Keyboard>/d"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""action"": ""movement"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": true |
|||
}, |
|||
{ |
|||
""name"": """", |
|||
""id"": ""ab696218-63cd-4eb8-9fe1-48a68e32e92f"", |
|||
""path"": ""<Keyboard>/space"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""action"": ""jump"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": false |
|||
}, |
|||
{ |
|||
""name"": """", |
|||
""id"": ""7adcb138-5175-4cc4-addc-d2b02cb5f0de"", |
|||
""path"": ""<Gamepad>/buttonSouth"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""action"": ""jump"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": false |
|||
} |
|||
] |
|||
} |
|||
], |
|||
""controlSchemes"": [ |
|||
{ |
|||
""name"": ""Keyboard"", |
|||
""bindingGroup"": ""Keyboard"", |
|||
""devices"": [ |
|||
{ |
|||
""devicePath"": ""<Keyboard>"", |
|||
""isOptional"": true, |
|||
""isOR"": false |
|||
}, |
|||
{ |
|||
""devicePath"": ""<Gamepad>"", |
|||
""isOptional"": true, |
|||
""isOR"": false |
|||
} |
|||
] |
|||
} |
|||
] |
|||
}");
|
|||
// Movement
|
|||
m_Movement = asset.FindActionMap("Movement", throwIfNotFound: true); |
|||
m_Movement_movement = m_Movement.FindAction("movement", throwIfNotFound: true); |
|||
m_Movement_jump = m_Movement.FindAction("jump", throwIfNotFound: true); |
|||
} |
|||
|
|||
public void Dispose() |
|||
{ |
|||
UnityEngine.Object.Destroy(asset); |
|||
} |
|||
|
|||
public InputBinding? bindingMask |
|||
{ |
|||
get => asset.bindingMask; |
|||
set => asset.bindingMask = value; |
|||
} |
|||
|
|||
public ReadOnlyArray<InputDevice>? devices |
|||
{ |
|||
get => asset.devices; |
|||
set => asset.devices = value; |
|||
} |
|||
|
|||
public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes; |
|||
|
|||
public bool Contains(InputAction action) |
|||
{ |
|||
return asset.Contains(action); |
|||
} |
|||
|
|||
public IEnumerator<InputAction> GetEnumerator() |
|||
{ |
|||
return asset.GetEnumerator(); |
|||
} |
|||
|
|||
IEnumerator IEnumerable.GetEnumerator() |
|||
{ |
|||
return GetEnumerator(); |
|||
} |
|||
|
|||
public void Enable() |
|||
{ |
|||
asset.Enable(); |
|||
} |
|||
|
|||
public void Disable() |
|||
{ |
|||
asset.Disable(); |
|||
} |
|||
public IEnumerable<InputBinding> bindings => asset.bindings; |
|||
|
|||
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false) |
|||
{ |
|||
return asset.FindAction(actionNameOrId, throwIfNotFound); |
|||
} |
|||
public int FindBinding(InputBinding bindingMask, out InputAction action) |
|||
{ |
|||
return asset.FindBinding(bindingMask, out action); |
|||
} |
|||
|
|||
// Movement
|
|||
private readonly InputActionMap m_Movement; |
|||
private IMovementActions m_MovementActionsCallbackInterface; |
|||
private readonly InputAction m_Movement_movement; |
|||
private readonly InputAction m_Movement_jump; |
|||
public struct MovementActions |
|||
{ |
|||
private @PushBlockActions m_Wrapper; |
|||
public MovementActions(@PushBlockActions wrapper) { m_Wrapper = wrapper; } |
|||
public InputAction @movement => m_Wrapper.m_Movement_movement; |
|||
public InputAction @jump => m_Wrapper.m_Movement_jump; |
|||
public InputActionMap Get() { return m_Wrapper.m_Movement; } |
|||
public void Enable() { Get().Enable(); } |
|||
public void Disable() { Get().Disable(); } |
|||
public bool enabled => Get().enabled; |
|||
public static implicit operator InputActionMap(MovementActions set) { return set.Get(); } |
|||
public void SetCallbacks(IMovementActions instance) |
|||
{ |
|||
if (m_Wrapper.m_MovementActionsCallbackInterface != null) |
|||
{ |
|||
@movement.started -= m_Wrapper.m_MovementActionsCallbackInterface.OnMovement; |
|||
@movement.performed -= m_Wrapper.m_MovementActionsCallbackInterface.OnMovement; |
|||
@movement.canceled -= m_Wrapper.m_MovementActionsCallbackInterface.OnMovement; |
|||
@jump.started -= m_Wrapper.m_MovementActionsCallbackInterface.OnJump; |
|||
@jump.performed -= m_Wrapper.m_MovementActionsCallbackInterface.OnJump; |
|||
@jump.canceled -= m_Wrapper.m_MovementActionsCallbackInterface.OnJump; |
|||
} |
|||
m_Wrapper.m_MovementActionsCallbackInterface = instance; |
|||
if (instance != null) |
|||
{ |
|||
@movement.started += instance.OnMovement; |
|||
@movement.performed += instance.OnMovement; |
|||
@movement.canceled += instance.OnMovement; |
|||
@jump.started += instance.OnJump; |
|||
@jump.performed += instance.OnJump; |
|||
@jump.canceled += instance.OnJump; |
|||
} |
|||
} |
|||
} |
|||
public MovementActions @Movement => new MovementActions(this); |
|||
private int m_KeyboardSchemeIndex = -1; |
|||
public InputControlScheme KeyboardScheme |
|||
{ |
|||
get |
|||
{ |
|||
if (m_KeyboardSchemeIndex == -1) m_KeyboardSchemeIndex = asset.FindControlSchemeIndex("Keyboard"); |
|||
return asset.controlSchemes[m_KeyboardSchemeIndex]; |
|||
} |
|||
} |
|||
public interface IMovementActions |
|||
{ |
|||
void OnMovement(InputAction.CallbackContext context); |
|||
void OnJump(InputAction.CallbackContext context); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: d6f125a5c899346259be7aac2df8daa0 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using Unity.MLAgents.Extensions.Input; |
|||
using UnityEngine; |
|||
using UnityEngine.InputSystem; |
|||
|
|||
/// <summary>
|
|||
/// This class handles the input for the PushBlock Cube character in the PushBlock scene.
|
|||
/// Note that the only ML-Agents code here is the implementation of the <see cref="IInputActionAssetProvider"/>.
|
|||
/// The <see cref="InputActuatorComponent"/> looks for a component that implements that interface in order to
|
|||
/// rebind actions to virtual controllers when training agents or running inference. This means that you can
|
|||
/// keep your input handling code separate from ML-Agents, and have your agent's action space defined by the
|
|||
/// actions defined in your project's <see cref="GetInputActionAsset"/>.
|
|||
///
|
|||
/// If you don't implement <see cref="IInputActionAssetProvider"/> the <see cref="InputActuatorComponent"/> will
|
|||
/// look for a <see cref="PlayerInput"/> component on the GameObject it live on. It will rebind the actions of that
|
|||
/// instance of the asset.
|
|||
///
|
|||
/// It is important to note that if you have multiple components on the same GameObject handling input, you will
|
|||
/// need to share the instance of the generated C# <see cref="IInputActionCollection2"/> (named <see cref="m_PushBlockActions"/>
|
|||
/// here) in order to ensure that all of your actions are bound correctly for ml-agents training and inference.
|
|||
/// </summary>
|
|||
public class PushBlockPlayerController : MonoBehaviour, IInputActionAssetProvider |
|||
{ |
|||
|
|||
PushBlockSettings m_PushBlockSettings; |
|||
public float JumpTime = 0.5f; |
|||
float m_JumpTimeRemaining; |
|||
Rigidbody m_PlayerRb; //cached on initialization
|
|||
PushBlockActions m_PushBlockActions; |
|||
float m_JumpCoolDownStart; |
|||
|
|||
void Awake() |
|||
{ |
|||
m_PushBlockSettings = FindObjectOfType<PushBlockSettings>(); |
|||
LazyInitializeActions(); |
|||
|
|||
// Cache the agent rigidbody
|
|||
m_PlayerRb = GetComponent<Rigidbody>(); |
|||
} |
|||
|
|||
void LazyInitializeActions() |
|||
{ |
|||
if (m_PushBlockActions != null) |
|||
{ |
|||
return; |
|||
} |
|||
m_PushBlockActions = new PushBlockActions(); |
|||
m_PushBlockActions.Enable(); |
|||
|
|||
// You can listen to C# events.
|
|||
m_PushBlockActions.Movement.jump.performed += JumpOnperformed; |
|||
} |
|||
|
|||
void JumpOnperformed(InputAction.CallbackContext callbackContext) |
|||
{ |
|||
InnerJump(gameObject.transform); |
|||
} |
|||
|
|||
void FixedUpdate() |
|||
{ |
|||
// Or you can poll the action itself like we do here.
|
|||
InnerMove(gameObject.transform, m_PushBlockActions.Movement.movement.ReadValue<Vector2>()); |
|||
if (m_JumpTimeRemaining < 0) |
|||
{ |
|||
m_PlayerRb.AddForce(-transform.up * (m_PushBlockSettings.agentJumpForce * 3), ForceMode.Acceleration); |
|||
} |
|||
m_JumpTimeRemaining -= Time.fixedDeltaTime; |
|||
} |
|||
|
|||
void InnerJump(Transform t) |
|||
{ |
|||
if (Time.realtimeSinceStartup - m_JumpCoolDownStart > m_PushBlockSettings.agentJumpCoolDown) |
|||
{ |
|||
m_JumpTimeRemaining = JumpTime; |
|||
m_PlayerRb.AddForce(t.up * m_PushBlockSettings.agentJumpForce, ForceMode.VelocityChange); |
|||
m_JumpCoolDownStart = Time.realtimeSinceStartup; |
|||
} |
|||
} |
|||
|
|||
void InnerMove(Transform t, Vector2 v) |
|||
{ |
|||
var forward = CreateForwardVector(v); |
|||
var up = CreateUpVector(v); |
|||
var dirToGo = t.forward * forward; |
|||
var rotateDir = t.up * up; |
|||
t.Rotate(rotateDir, Time.deltaTime * 200f); |
|||
m_PlayerRb.AddForce(dirToGo * m_PushBlockSettings.agentRunSpeed, |
|||
ForceMode.VelocityChange); |
|||
} |
|||
|
|||
static float CreateUpVector(Vector2 move) |
|||
{ |
|||
return Mathf.Abs(move.x) > Mathf.Abs(move.y) ? move.x : 0f; |
|||
} |
|||
|
|||
static float CreateForwardVector(Vector2 move) |
|||
{ |
|||
return Mathf.Abs(move.y) > Mathf.Abs(move.x) ? move.y : 0f; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// This is the implementation of the <see cref="IInputActionAssetProvider"/> for this class. We need
|
|||
/// both the <see cref="GetInputActionAsset"/> and the <see cref="IInputActionCollection2"/> if you are
|
|||
/// listening to C# events, Unity Events, or receiving Messages from the Input System Package as those callbacks
|
|||
/// are set up through the generated <see cref="IInputActionCollection2"/>.
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
public (InputActionAsset, IInputActionCollection2) GetInputActionAsset() |
|||
{ |
|||
LazyInitializeActions(); |
|||
return (m_PushBlockActions.asset, m_PushBlockActions); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: bb9a2d951ffa44f53ba04a31f2712f5f |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
|
|||
public class PushBlockSettings : MonoBehaviour |
|||
{ |
|||
/// <summary>
|
|||
/// The "walking speed" of the agents in the scene.
|
|||
/// </summary>
|
|||
public float agentRunSpeed; |
|||
|
|||
/// <summary>
|
|||
/// The agent rotation speed.
|
|||
/// Every agent will use this setting.
|
|||
/// </summary>
|
|||
public float agentRotationSpeed; |
|||
|
|||
public float agentJumpForce; |
|||
|
|||
public float agentJumpCoolDown; |
|||
|
|||
/// <summary>
|
|||
/// The spawn area margin multiplier.
|
|||
/// ex: .9 means 90% of spawn area will be used.
|
|||
/// .1 margin will be left (so players don't spawn off of the edge).
|
|||
/// The higher this value, the longer training time required.
|
|||
/// </summary>
|
|||
public float spawnAreaMarginMultiplier; |
|||
|
|||
/// <summary>
|
|||
/// When a goal is scored the ground will switch to this
|
|||
/// material for a few seconds.
|
|||
/// </summary>
|
|||
public Material goalScoredMaterial; |
|||
|
|||
/// <summary>
|
|||
/// When an agent fails, the ground will turn this material for a few seconds.
|
|||
/// </summary>
|
|||
public Material failMaterial; |
|||
|
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: e5ed63dbfa25542ecb8bc013adfba183 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 5855121f0ded74dad8e1dd15a8bcdca1 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock/TFModels/PushBlock.onnx
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: bee50ae7fd03e4e16a4ac45db4d96f6e |
|||
ScriptedImporter: |
|||
internalIDToNameTable: [] |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3} |
|||
optimizeModel: 1 |
|||
forceArbitraryBatchSize: 1 |
|||
treatErrorsAsWarnings: 0 |
|||
importMode: 1 |
|
|||
fileFormatVersion: 2 |
|||
guid: 0f83c851cdce246a0b97472ec6d35622 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue