-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e2265d
commit 0bc8289
Showing
7 changed files
with
284 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
Project/Assets/ML-Agents/Examples/NavMeshTest/Scripts/LineRender.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using UnityEngine; | ||
|
||
public class LineRender : MonoBehaviour | ||
{ | ||
private LineRenderer line; | ||
private Vector3 previousPosition; | ||
[SerializeField] private float minDistance = 0.1f; | ||
[SerializeField, Range(0f, 20f)] private float width = 2f; | ||
|
||
private void Start() | ||
{ | ||
line = GetComponent<LineRenderer>(); | ||
line.positionCount = 1; | ||
previousPosition = transform.position; | ||
line.SetPosition(0, previousPosition); | ||
line.startWidth = line.endWidth = width; | ||
} | ||
|
||
private void Update() | ||
{ | ||
Vector3 currentPosition = transform.position; | ||
currentPosition.y = 0f; | ||
|
||
if (Vector3.Distance(currentPosition, previousPosition) > minDistance) | ||
{ | ||
line.positionCount++; | ||
line.SetPosition(line.positionCount - 1, currentPosition); | ||
previousPosition = currentPosition; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Project/Assets/ML-Agents/Examples/NavMeshTest/Scripts/LineRender.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
Project/Assets/ML-Agents/Examples/SharedAssets/Materials/SpiritBlue.mat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!21 &2100000 | ||
Material: | ||
serializedVersion: 8 | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_Name: SpiritBlue | ||
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} | ||
m_Parent: {fileID: 0} | ||
m_ModifiedSerializedProperties: 0 | ||
m_ValidKeywords: [] | ||
m_InvalidKeywords: [] | ||
m_LightmapFlags: 4 | ||
m_EnableInstancingVariants: 0 | ||
m_DoubleSidedGI: 0 | ||
m_CustomRenderQueue: -1 | ||
stringTagMap: {} | ||
disabledShaderPasses: [] | ||
m_LockedProperties: | ||
m_SavedProperties: | ||
serializedVersion: 3 | ||
m_TexEnvs: | ||
- _AlphaTex: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _BumpMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailAlbedoMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailMask: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailNormalMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _EmissionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MainTex: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MetallicGlossMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _OcclusionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _ParallaxMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
m_Ints: [] | ||
m_Floats: | ||
- PixelSnap: 0 | ||
- _BumpScale: 1 | ||
- _Cutoff: 0.5 | ||
- _DetailNormalMapScale: 1 | ||
- _DstBlend: 0 | ||
- _EnableExternalAlpha: 0 | ||
- _GlossMapScale: 1 | ||
- _Glossiness: 0.5 | ||
- _GlossyReflections: 1 | ||
- _Metallic: 0 | ||
- _Mode: 0 | ||
- _OcclusionStrength: 1 | ||
- _Parallax: 0.02 | ||
- _SmoothnessTextureChannel: 0 | ||
- _SpecularHighlights: 1 | ||
- _SrcBlend: 1 | ||
- _UVSec: 0 | ||
- _ZWrite: 1 | ||
m_Colors: | ||
- _Color: {r: 0, g: 0, b: 1, a: 1} | ||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} | ||
- _Flip: {r: 1, g: 1, b: 1, a: 1} | ||
- _RendererColor: {r: 1, g: 1, b: 1, a: 1} | ||
m_BuildTextureStacks: [] |
8 changes: 8 additions & 0 deletions
8
Project/Assets/ML-Agents/Examples/SharedAssets/Materials/SpiritBlue.mat.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.