From 3f0d835016251b916f74081e62901b16cebd4a80 Mon Sep 17 00:00:00 2001 From: Rudrangshu Nandi Date: Sun, 19 Aug 2018 01:20:54 +0530 Subject: [PATCH] Updated Player Audio Distance and Screen Text --- Assets/Scenes/Home.unity | 80 ++++++++++++++++++- Assets/Scenes/Main.unity | 2 +- .../Player/Movement/PlayerCarController.cs | 6 +- 3 files changed, 82 insertions(+), 6 deletions(-) diff --git a/Assets/Scenes/Home.unity b/Assets/Scenes/Home.unity index 355e8a0..a48ca87 100644 --- a/Assets/Scenes/Home.unity +++ b/Assets/Scenes/Home.unity @@ -689,6 +689,7 @@ RectTransform: - {fileID: 1488636869} - {fileID: 1940156156} - {fileID: 1658810525} + - {fileID: 885883611} m_Father: {fileID: 161721485} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -961,6 +962,81 @@ RectTransform: m_CorrespondingSourceObject: {fileID: 224542051681485936, guid: c964729d225b5204caeb9632eb750b62, type: 2} m_PrefabInternal: {fileID: 808171049} +--- !u!1 &885883610 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 885883611} + - component: {fileID: 885883613} + - component: {fileID: 885883612} + m_Layer: 5 + m_Name: Info_4 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &885883611 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 885883610} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.99999905, y: 0.99999905, z: 0.99999905} + m_Children: [] + m_Father: {fileID: 534069043} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0.000030517578, y: -282.2} + m_SizeDelta: {x: 0, y: 62.7} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &885883612 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 885883610} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: eec7152cfa11b0649a25fe1a209e56f3, type: 3} + m_FontSize: 20 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Slide and J-Turn your way out of situations +--- !u!222 &885883613 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 885883610} + m_CullTransparentMesh: 0 --- !u!1 &1426013608 GameObject: m_ObjectHideFlags: 0 @@ -1180,7 +1256,7 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: Stay alive for as long as possible. + m_Text: Stay alive for as long as possible --- !u!222 &1658810527 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1391,7 +1467,7 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: Avoid Police. Don't get Busted or Killed + m_Text: Avoid the Police. Don't get Busted or Killed --- !u!222 &1940156158 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 090491a..4b78581 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -5140,7 +5140,7 @@ MonoBehaviour: minAudioPitch: 1 pitchLerpRatio: 0.4 minDistanceToPlayer: 5 - maxDistanceToPlayer: 15 + maxDistanceToPlayer: 20 maxVehiclesToConsider: 7 --- !u!1 &550054381 GameObject: diff --git a/Assets/Scripts/Player/Movement/PlayerCarController.cs b/Assets/Scripts/Player/Movement/PlayerCarController.cs index de00141..d3c8df1 100644 --- a/Assets/Scripts/Player/Movement/PlayerCarController.cs +++ b/Assets/Scripts/Player/Movement/PlayerCarController.cs @@ -62,21 +62,21 @@ private void UpdateTrails() UpdateTrail(frontLTrail, frontLWheelCollider, true); // Front Right Wheel - result = frontLWheelCollider.GetGroundHit(out wheelHit); + result = frontRWheelCollider.GetGroundHit(out wheelHit); if (result && wheelHit.collider.CompareTag(TagManager.Terrain)) UpdateTrail(frontRTrail, frontRWheelCollider); else UpdateTrail(frontRTrail, frontRWheelCollider, true); // Rear Left Wheel - result = frontLWheelCollider.GetGroundHit(out wheelHit); + result = rearLWheelCollider.GetGroundHit(out wheelHit); if (result && wheelHit.collider.CompareTag(TagManager.Terrain)) UpdateTrail(rearLTrail, rearLWheelCollider); else UpdateTrail(rearLTrail, rearLWheelCollider, true); // Rear Right Wheel - result = frontLWheelCollider.GetGroundHit(out wheelHit); + result = rearRWheelCollider.GetGroundHit(out wheelHit); if (result && wheelHit.collider.CompareTag(TagManager.Terrain)) UpdateTrail(rearRTrail, rearRWheelCollider); else