Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example project for the InputSystemActuator. #4976

Merged
merged 3 commits into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions ML-Agents-Input-Example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/[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
33 changes: 33 additions & 0 deletions ML-Agents-Input-Example/Assets/InputSystem.inputsettings.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
%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:

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions ML-Agents-Input-Example/Assets/ML-Agents.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions ML-Agents-Input-Example/Assets/ML-Agents/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#if UNITY_CLOUD_BUILD
using UnityEditor;

public class DisableBurstFromMenu
{
/// This method is needed to disable Burst compilation on windows for our cloudbuild tests.
/// Barracuda 0.4.0-preview depends on a version of Burst (1.1.1) which does not allow
/// users to disable burst compilation on a per platform basis. The burst version 1.3.0-preview-1
/// allows for cross compilation, but is not released yet.
///
/// We will be able to remove this when
/// 1. Barracuda updates burst 1.3.0-preview-1 or
/// 2. We update our edior version for our tests to 2019.1+
public static void DisableBurstCompilation()
{
EditorApplication.ExecuteMenuItem("Jobs/Burst/Enable Compilation");
}
}
#endif

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions ML-Agents-Input-Example/Assets/ML-Agents/Editor/Tests.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using System;
using UnityEditor;
using UnityEngine;
using UnityEditor.Build.Reporting;

namespace Unity.MLAgents
{
public class StandaloneBuildTest
{
const string k_OutputCommandLineFlag = "--mlagents-build-output-path";
const string k_SceneCommandLineFlag = "--mlagents-build-scene-path";
private const string k_BuildTargetFlag = "--mlagents-build-target";

public static void BuildStandalonePlayerOSX()
{
// Read commandline arguments for options
var outputPath = "testPlayer";
var scenePath = "Assets/ML-Agents/Examples/3DBall/Scenes/3DBall.unity";
var buildTarget = BuildTarget.StandaloneOSX;

var args = Environment.GetCommandLineArgs();
for (var i = 0; i < args.Length - 1; i++)
{
if (args[i] == k_OutputCommandLineFlag)
{
outputPath = args[i + 1];
Debug.Log($"Overriding output path to {outputPath}");
}
else if (args[i] == k_SceneCommandLineFlag)
{
scenePath = args[i + 1];
}
else if (args[i] == k_BuildTargetFlag)
{
buildTarget = (BuildTarget)Enum.Parse(typeof(BuildTarget), args[i + 1], ignoreCase: true);
}
}

string[] scenes = { scenePath };
var buildResult = BuildPipeline.BuildPlayer(
scenes,
outputPath,
buildTarget,
BuildOptions.None
);
var isOk = buildResult.summary.result == BuildResult.Succeeded;
var error = "";
foreach (var stepInfo in buildResult.steps)
{
foreach (var msg in stepInfo.messages)
{
if (msg.type != LogType.Log && msg.type != LogType.Warning)
{
error += msg.content + "\n";
}
}
}
if (isOk)
{
EditorApplication.Exit(0);
}
else
{
Console.Error.WriteLine(error);
EditorApplication.Exit(1);

}
Debug.Log(error);

}

}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions ML-Agents-Input-Example/Assets/ML-Agents/Examples.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions ML-Agents-Input-Example/Assets/ML-Agents/Examples/PushBlock.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Loading