Hunter
5 年前
当前提交
c92a9008
共有 21 个文件被更改,包括 2495 次插入 和 252 次删除
-
4UnitySDK/Assets/ML-Agents/Examples/Soccer/Materials/Physic_Materials/zeroFriction.physicMaterial
-
6UnitySDK/Assets/ML-Agents/Examples/WallJump/Brains/BigWallJumpLearning.asset
-
6UnitySDK/Assets/ML-Agents/Examples/WallJump/Brains/SmallWallJumpLearning.asset
-
4UnitySDK/Assets/ML-Agents/Examples/WallJump/Brains/WallJumpPlayer.asset
-
390UnitySDK/Assets/ML-Agents/Examples/WallJump/Prefabs/WallJumpArea.prefab
-
365UnitySDK/Assets/ML-Agents/Examples/WallJump/Scenes/WallJump.unity
-
10UnitySDK/Assets/ML-Agents/Examples/WallJump/Scripts/WallJumpAcademy.cs
-
374UnitySDK/Assets/ML-Agents/Examples/WallJump/Scripts/WallJumpAgent.cs
-
5UnitySDK/ProjectSettings/EditorBuildSettings.asset
-
6UnitySDK/ProjectSettings/ProjectSettings.asset
-
9UnitySDK/ProjectSettings/TimeManager.asset
-
57config/trainer_config.yaml
-
98UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Scripts/AgentCubeGroundCheck.cs
-
11UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Scripts/AgentCubeGroundCheck.cs.meta
-
367UnitySDK/Assets/ML-Agents/Examples/WallJump/Brains/BigWallJumpLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/WallJump/Brains/BigWallJumpLearning.nn.meta
-
1001UnitySDK/Assets/ML-Agents/Examples/WallJump/Brains/SmallWallJumpLearning.nn
-
7UnitySDK/Assets/ML-Agents/Examples/WallJump/Brains/SmallWallJumpLearning.nn.meta
-
1UnitySDK/csharp_timers.json
-
1csharp_timers.json
-
18UnitySDK/UnitySDK.sln.DotSettings
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!5 &1 |
|||
TimeManager: |
|||
m_ObjectHideFlags: 0 |
|||
Fixed Timestep: 0.02 |
|||
Maximum Allowed Timestep: 0.33333334 |
|||
m_TimeScale: 1 |
|||
Maximum Particle Timestep: 0.03 |
|
|||
using System.Collections; |
|||
using UnityEngine; |
|||
// using MLAgents;
|
|||
|
|||
namespace MLAgents |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// Perform Groundcheck using a Physics OverlapBox
|
|||
/// </summary>
|
|||
[DisallowMultipleComponent] |
|||
public class AgentCubeGroundCheck : MonoBehaviour |
|||
{ |
|||
public bool debugDrawGizmos; |
|||
// public List<string> tagsToDetect = new List<string>(){"walkableSurface", "block"};
|
|||
public Collider[] hitGroundColliders = new Collider[3]; |
|||
|
|||
public Vector3 groundCheckBoxLocalPos = new Vector3(0,-0.52f, 0); |
|||
public Vector3 groundCheckBoxSize = new Vector3(0.99f, 0.02f, 0.99f); |
|||
public bool isGrounded; |
|||
public float ungroundedTime; //amount of time agent hasn't been grounded
|
|||
|
|||
|
|||
void FixedUpdate() |
|||
{ |
|||
DoGroundCheck(); |
|||
if(!isGrounded) |
|||
{ |
|||
ungroundedTime += Time.deltaTime; |
|||
} |
|||
else |
|||
{ |
|||
ungroundedTime = 0; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Does the ground check.
|
|||
/// </summary>
|
|||
/// <returns><c>true</c>, if the agent is on the ground,
|
|||
/// <c>false</c> otherwise.</returns>
|
|||
/// <param name="smallCheck"></param>
|
|||
public void DoGroundCheck() |
|||
{ |
|||
// hitGroundColliders = new Collider[3];
|
|||
isGrounded = false; |
|||
if(Physics.OverlapBoxNonAlloc( |
|||
transform.TransformPoint(groundCheckBoxLocalPos), |
|||
groundCheckBoxSize/2, |
|||
hitGroundColliders, |
|||
transform.rotation) > 0) |
|||
{ |
|||
foreach (var col in hitGroundColliders) |
|||
{ |
|||
// if (col != null && col.transform != transform &&
|
|||
// (col.CompareTag("walkableSurface") ||
|
|||
// col.CompareTag("block") ||
|
|||
// col.CompareTag("wall")))
|
|||
// {
|
|||
if (col != null && col.transform != transform && |
|||
(col.CompareTag("walkableSurface") || |
|||
// col.CompareTag("wall") ||
|
|||
col.CompareTag("block"))) |
|||
{ |
|||
isGrounded = true; //then we're grounded
|
|||
break; |
|||
} |
|||
} |
|||
} |
|||
//empty the array
|
|||
for (int i = 0; i < hitGroundColliders.Length; i++) |
|||
{ |
|||
hitGroundColliders[i] = null; |
|||
} |
|||
} |
|||
|
|||
//Draw the Box Overlap as a gizmo to show where it currently is testing. Click the Gizmos button to see this
|
|||
void OnDrawGizmos() |
|||
{ |
|||
if (debugDrawGizmos) |
|||
{ |
|||
// Convert the local coordinate values into world
|
|||
// coordinates for the matrix transformation.
|
|||
//Draw a cube where the OverlapBox is (positioned where your GameObject is as well as a size)
|
|||
// Gizmos.DrawWireCube(transform.position, transform.localScale);
|
|||
|
|||
Gizmos.color = Color.red; |
|||
Gizmos.matrix = transform.localToWorldMatrix; |
|||
Gizmos.DrawWireCube(groundCheckBoxLocalPos, groundCheckBoxSize); |
|||
// Gizmos.color = Color.blue;
|
|||
// Gizmos.DrawWireCube(transform.TransformPoint(groundCheckBoxLocalPos), groundCheckBoxSize);
|
|||
|
|||
// Gizmos.DrawWireCube(transform.TransformPoint(groundCheckBoxLocalPos), transform.localScale);
|
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: e340869c035f9451681a919fc0bf98b2 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
367
UnitySDK/Assets/ML-Agents/Examples/WallJump/Brains/BigWallJumpLearning.nn
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 63d1ecc7b513b452dbb35847816f506b |
|||
ScriptedImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3} |
1001
UnitySDK/Assets/ML-Agents/Examples/WallJump/Brains/SmallWallJumpLearning.nn
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 810652450bd9048e5846b47d543eec07 |
|||
ScriptedImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3} |
|
|||
{"count":1,"self":75.7271104,"total":89.109481,"children":{"AgentResetIfDone":{"count":4360,"self":0.21384199999999998,"total":0.21384199999999998,"children":null},"AgentSendState":{"count":4360,"self":1.359667,"total":3.765707,"children":{"CollectObservations":{"count":34896,"self":2.40604,"total":2.40604,"children":null}}},"BrainDecideAction":{"count":4360,"self":6.1270219999999993,"total":6.1270219999999993,"children":null},"AcademyStep":{"count":4360,"self":0.119783,"total":0.119783,"children":null},"AgentAct":{"count":4360,"self":3.155154,"total":3.155154,"children":null}}} |
|
|||
{"count":1,"self":734.6514432,"total":19807.115766,"children":{"AgentResetIfDone":{"count":986659,"self":10.4867776,"total":10.486778,"children":null},"AgentSendState":{"count":986659,"self":64.5328,"total":294.04925099999997,"children":{"CollectObservations":{"count":7893288,"self":229.51644159999998,"total":229.51645399999998,"children":null}}},"BrainDecideAction":{"count":986659,"self":18022.7817472,"total":18022.782152,"children":null},"AcademyStep":{"count":986659,"self":6.2750179999999993,"total":6.2750179999999993,"children":null},"AgentAct":{"count":986659,"self":738.8690944,"total":738.86911,"children":null}}} |
|
|||
<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/=BLAS/@EntryIndexedValue">BLAS</s:String> |
|||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CPU/@EntryIndexedValue">CPU</s:String> |
|||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GPU/@EntryIndexedValue">GPU</s:String> |
|||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NN/@EntryIndexedValue">NN</s:String> |
|||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RL/@EntryIndexedValue">RL</s:String> |
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=BLAS/@EntryIndexedValue">True</s:Boolean> |
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Logits/@EntryIndexedValue">True</s:Boolean> |
|||
|
|||
|
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Marsaglia/@EntryIndexedValue">True</s:Boolean> |
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=multinomial/@EntryIndexedValue">True</s:Boolean> |
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Probs/@EntryIndexedValue">True</s:Boolean> |
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=protobuf/@EntryIndexedValue">True</s:Boolean> |
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Scaler/@EntryIndexedValue">True</s:Boolean> |
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Scriptable/@EntryIndexedValue">True</s:Boolean> |
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=stddev/@EntryIndexedValue">True</s:Boolean> |
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=vals/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |
撰写
预览
正在加载...
取消
保存
Reference in new issue