Skip to content

Commit

Permalink
Added sample terrain to gameScene, updated BattleRoller prefab, playe…
Browse files Browse the repository at this point in the history
…r camera in build

v0.15
  • Loading branch information
AitorSimona committed Jan 4, 2021
1 parent dc3b7a5 commit 450f6e1
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 116 deletions.
182 changes: 177 additions & 5 deletions BottomGear/Assets/Game/Scenes/GameScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Light:
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 0.75
m_Intensity: 2
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
Expand Down Expand Up @@ -377,13 +377,109 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 523789977}
m_LocalRotation: {x: 0.41102695, y: -0, z: -0, w: 0.91162324}
m_LocalPosition: {x: 0, y: 70.7, z: -74.5}
m_LocalRotation: {x: 0.28135476, y: -0, z: -0, w: 0.95960385}
m_LocalPosition: {x: 0, y: 193.8, z: -377.8}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 48.539, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 32.682, y: 0, z: 0}
--- !u!1 &593042560
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 593042564}
- component: {fileID: 593042563}
- component: {fileID: 593042562}
- component: {fileID: 593042561}
m_Layer: 0
m_Name: Capsule
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!136 &593042561
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 593042560}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
m_Radius: 0.5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &593042562
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 593042560}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 7b7128dc8984e21449e952bf79f240f4, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &593042563
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 593042560}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &593042564
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 593042560}
m_LocalRotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071068}
m_LocalPosition: {x: -11, y: -21, z: 141}
m_LocalScale: {x: 1000, y: 750, z: 1000}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90}
--- !u!1 &601629550
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -536,6 +632,82 @@ MonoBehaviour:
m_EditorClassIdentifier:
Countdown: 5
Text: {fileID: 601629552}
--- !u!1 &1063431883
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1063431886}
- component: {fileID: 1063431885}
- component: {fileID: 1063431884}
m_Layer: 0
m_Name: Terrain
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!154 &1063431884
TerrainCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1063431883}
m_Material: {fileID: 0}
m_Enabled: 1
m_TerrainData: {fileID: 15600000, guid: 4c5139cf80b8fde46b394d866571370d, type: 2}
m_EnableTreeColliders: 1
--- !u!218 &1063431885
Terrain:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1063431883}
m_Enabled: 1
serializedVersion: 6
m_TerrainData: {fileID: 15600000, guid: 4c5139cf80b8fde46b394d866571370d, type: 2}
m_TreeDistance: 5000
m_TreeBillboardDistance: 50
m_TreeCrossFadeLength: 5
m_TreeMaximumFullLODCount: 50
m_DetailObjectDistance: 80
m_DetailObjectDensity: 1
m_HeightmapPixelError: 5
m_SplatMapDistance: 1000
m_HeightmapMaximumLOD: 0
m_ShadowCastingMode: 2
m_DrawHeightmap: 1
m_DrawInstanced: 0
m_DrawTreesAndFoliage: 1
m_ReflectionProbeUsage: 1
m_MaterialTemplate: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e, type: 2}
m_BakeLightProbesForTrees: 1
m_PreserveTreePrototypeLayers: 0
m_DeringLightProbesForTrees: 1
m_ScaleInLightmap: 0.0256
m_LightmapParameters: {fileID: 15203, guid: 0000000000000000f000000000000000, type: 0}
m_GroupingID: 0
m_RenderingLayerMask: 1
m_AllowAutoConnect: 1
--- !u!4 &1063431886
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1063431883}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -761, y: -21, z: -359}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1308668355
GameObject:
m_ObjectHideFlags: 0
Expand All @@ -554,7 +726,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!64 &1308668356
MeshCollider:
m_ObjectHideFlags: 0
Expand Down
100 changes: 0 additions & 100 deletions BottomGear/Assets/Game/Scenes/TestScenes/Vehicle.unity
Original file line number Diff line number Diff line change
Expand Up @@ -521,46 +521,10 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 865184823, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_Drag
value: 0
objectReference: {fileID: 0}
- target: {fileID: 865184823, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_Mass
value: 1000
objectReference: {fileID: 0}
- target: {fileID: 865184823, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_AngularDrag
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 865184823, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_CollisionDetection
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1389970386, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1817820544, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: test
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1817820544, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: maxAngle
value: 30
objectReference: {fileID: 0}
- target: {fileID: 1817820544, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: maxSpeed
value: 30
objectReference: {fileID: 0}
- target: {fileID: 1817820544, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: maxTorque
value: 2500
objectReference: {fileID: 0}
- target: {fileID: 1817820544, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: criticalSpeed
value: 20
objectReference: {fileID: 0}
- target: {fileID: 1864884027688733411, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_Name
value: CustomCar
Expand Down Expand Up @@ -609,74 +573,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5151564807111174973, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_Center.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5151564807111174973, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_WheelDampingRate
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 5151564807111174973, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_SuspensionDistance
value: 0.3
objectReference: {fileID: 0}
- target: {fileID: 5151564807111174973, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_SuspensionSpring.damper
value: 1000
objectReference: {fileID: 0}
- target: {fileID: 6971916259143222507, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_Center.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6971916259143222507, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_WheelDampingRate
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 6971916259143222507, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_SuspensionDistance
value: 0.3
objectReference: {fileID: 0}
- target: {fileID: 6971916259143222507, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_SuspensionSpring.damper
value: 1000
objectReference: {fileID: 0}
- target: {fileID: 8607155943644011075, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: viewIdField
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8823429090271827014, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_Center.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8823429090271827014, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_WheelDampingRate
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 8823429090271827014, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_SuspensionDistance
value: 0.3
objectReference: {fileID: 0}
- target: {fileID: 8823429090271827014, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_SuspensionSpring.damper
value: 1000
objectReference: {fileID: 0}
- target: {fileID: 8962455898984354761, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_Center.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8962455898984354761, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_WheelDampingRate
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 8962455898984354761, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_SuspensionDistance
value: 0.3
objectReference: {fileID: 0}
- target: {fileID: 8962455898984354761, guid: 75980be8169e8844595d320b13a7e456, type: 3}
propertyPath: m_SuspensionSpring.damper
value: 1000
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 75980be8169e8844595d320b13a7e456, type: 3}
--- !u!1 &2113663694
Expand Down
10 changes: 10 additions & 0 deletions BottomGear/Assets/Game/Scripts/Car/WheelDrive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class WheelDrive : MonoBehaviour
private Rigidbody rb;
private Wheel[] m_Wheels;
public Transform centerOfMass;
public Camera camera;

struct Wheel
{
Expand All @@ -61,6 +62,15 @@ public void Awake()
// Find all the WheelColliders down in the hierarchy.
void Start()
{
// --- Deactivate camera if this is not the local player ---
if (camera != null)
{
if (!photonView.IsMine && Photon.Pun.PhotonNetwork.IsConnectedAndReady)
camera.enabled = false;
}
else
Debug.LogError("There is no valid camera in WheelDrive");

m_Wheels = new Wheel[wheelCount];
WheelCollider[] cWheels = GetComponentsInChildren<WheelCollider>();

Expand Down
Loading

0 comments on commit 450f6e1

Please sign in to comment.