Skip to content

Commit

Permalink
#4 #1 Color coded trail renderes for new time mechanics revamo
Browse files Browse the repository at this point in the history
  • Loading branch information
Yisas authored and vladimirdlc committed Mar 3, 2017
1 parent d43e8cf commit 0e3b668
Show file tree
Hide file tree
Showing 7 changed files with 332 additions and 129 deletions.
127 changes: 127 additions & 0 deletions Assets/Materials/TrailRendererTexture.mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TrailRendererTexture
m_Shader: {fileID: 101, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 2c7a9dc0ebed75644891b3677e28d511, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
8 changes: 8 additions & 0 deletions Assets/Materials/TrailRendererTexture.mat.meta

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

132 changes: 130 additions & 2 deletions Assets/PATimeRefactor/Assets/Prefabs/Clone.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -1359,12 +1359,13 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 149790}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 6.6780496, y: 0.5, z: 5.044979}
m_LocalPosition: {x: 4.07, y: 4.3, z: 5.044979}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 469942}
- {fileID: 448028}
- {fileID: 4966505376668596}
- {fileID: 4391902850973756}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -2380,7 +2381,7 @@ Transform:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100098}
m_LocalRotation: {x: 0.5326752, y: 0.070340455, z: 0.83613276, w: -0.110415146}
m_LocalRotation: {x: 0.53267515, y: 0.07034045, z: 0.83613265, w: -0.11041513}
m_LocalPosition: {x: 0.000022271464, y: -0.00006150465, z: 0.026027026}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
Expand Down Expand Up @@ -2593,6 +2594,22 @@ Prefab:
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 149790}
m_IsPrefabParent: 1
--- !u!1 &1272078175215814
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4391902850973756}
- component: {fileID: 96460622104059996}
m_Layer: 10
m_Name: Shadow Trail Renderer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1539577905220170
GameObject:
m_ObjectHideFlags: 0
Expand All @@ -2610,6 +2627,19 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4391902850973756
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1272078175215814}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 408730}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4966505376668596
Transform:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -2661,6 +2691,104 @@ MeshFilter:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1539577905220170}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!96 &96460622104059996
TrailRenderer:
serializedVersion: 2
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1272078175215814}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_Materials:
- {fileID: 2100000, guid: 15e85adff46b6674a9be25fb008a91ad, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
m_Time: 5
m_Parameters:
serializedVersion: 2
widthMultiplier: 1
widthCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
colorGradient:
key0:
serializedVersion: 2
rgba: 4294967295
key1:
serializedVersion: 2
rgba: 4294967295
key2:
serializedVersion: 2
rgba: 0
key3:
serializedVersion: 2
rgba: 0
key4:
serializedVersion: 2
rgba: 0
key5:
serializedVersion: 2
rgba: 0
key6:
serializedVersion: 2
rgba: 0
key7:
serializedVersion: 2
rgba: 0
ctime0: 0
ctime1: 65535
ctime2: 0
ctime3: 0
ctime4: 0
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_NumColorKeys: 2
m_NumAlphaKeys: 2
numCornerVertices: 0
numCapVertices: 0
alignment: 0
textureMode: 0
m_MinVertexDistance: 0.1
m_Autodestruct: 0
--- !u!114 &114173871798548932
MonoBehaviour:
m_ObjectHideFlags: 1
Expand Down
6 changes: 5 additions & 1 deletion Assets/PATimeRefactor/Assets/Prefabs/TimeManager.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ MonoBehaviour:
cloneLayer: Clone
doorLayer: Door DELETEME
aiLayer: Puppy AI
sampleRate: 6
cloneColorCodes:
- {r: 1, g: 0, b: 0, a: 0}
- {r: 0, g: 0.37931037, b: 1, a: 0}
- {r: 0.94482756, g: 1, b: 0, a: 0}
sampleRate: 3
m_Player: {fileID: 0}
m_ClonePrefab: {fileID: 149790, guid: 3a65e8fe82479404e96efe155a409605, type: 2}
m_Puppy: {fileID: 0}
Expand Down
16 changes: 16 additions & 0 deletions Assets/PATimeRefactor/Assets/Scripts/CloneCharacterController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ public class CloneCharacterController : MonoBehaviour

public global::TimeManager.State m_Target { get; set; }

private TrailRenderer trail;

// Use this to tweak the value to trigger the blocking paradox
private float maxDistance;

private void Start()
{
m_Agent = GetComponent<UnityEngine.AI.NavMeshAgent>();
m_Character = GetComponent<Character>();
trail = GetComponentInChildren<TrailRenderer>();

m_Agent.updateRotation = true;
m_Agent.updatePosition = true;
Expand Down Expand Up @@ -46,6 +49,19 @@ private void LateUpdate()
if (m_Agent.remainingDistance > maxDistance) maxDistance = m_Agent.remainingDistance;
}

public void ColorCode(Color colorCode)
{
if(trail == null)
{
trail = GetComponentInChildren<TrailRenderer>();
}

//trail.material.SetColor("_TintColor",colorCode);
trail.material.color = colorCode;
trail.startColor = colorCode;
trail.endColor = colorCode;
}


}

Loading

0 comments on commit 0e3b668

Please sign in to comment.