diff --git a/Assets/Actors.meta b/Assets/Actors.meta new file mode 100644 index 0000000..aee58bf --- /dev/null +++ b/Assets/Actors.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 12a7be180881e3b48b766c77ccc78dd6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Actors/Automatic.meta b/Assets/Actors/Automatic.meta new file mode 100644 index 0000000..dae447a --- /dev/null +++ b/Assets/Actors/Automatic.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ce26bd13da1198f45b91e47347589729 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Actors/Controllable.meta b/Assets/Actors/Controllable.meta new file mode 100644 index 0000000..4a6c67e --- /dev/null +++ b/Assets/Actors/Controllable.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bec689ec1c367b74ca645956966fd43e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Actors/Controllable/Car.meta b/Assets/Actors/Controllable/Car.meta new file mode 100644 index 0000000..19e3529 --- /dev/null +++ b/Assets/Actors/Controllable/Car.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 98e009367120fcf4286721f5544bcf31 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Actors/Controllable/Car/Car Body.png b/Assets/Actors/Controllable/Car/Car Body.png new file mode 100644 index 0000000..53d35a4 Binary files /dev/null and b/Assets/Actors/Controllable/Car/Car Body.png differ diff --git a/Assets/Actors/Controllable/Car/Car Body.png.meta b/Assets/Actors/Controllable/Car/Car Body.png.meta new file mode 100644 index 0000000..2e76cdf --- /dev/null +++ b/Assets/Actors/Controllable/Car/Car Body.png.meta @@ -0,0 +1,130 @@ +fileFormatVersion: 2 +guid: 0601a27fa7aa1744287b8b9ea1308280 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Actors/Controllable/Car/Car.prefab b/Assets/Actors/Controllable/Car/Car.prefab new file mode 100644 index 0000000..be0db3c --- /dev/null +++ b/Assets/Actors/Controllable/Car/Car.prefab @@ -0,0 +1,883 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2159326893312496990 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7865009529694488039} + - component: {fileID: 185558675483813256} + - component: {fileID: 382105620855292410} + m_Layer: 0 + m_Name: Wheel Back Right Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7865009529694488039 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2159326893312496990} + serializedVersion: 2 + m_LocalRotation: {x: -0.7071067, y: -0.000000030908616, z: 0.000000030908623, w: 0.7071068} + m_LocalPosition: {x: 0.78276384, y: -0.7559926, z: -1.201448} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2301419002926063789} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!146 &185558675483813256 +WheelCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2159326893312496990} + serializedVersion: 2 + m_Center: {x: 0, y: 0, z: 0} + m_Radius: 0.44 + m_SuspensionSpring: + spring: 35000 + damper: 4500 + targetPosition: 0.5 + m_SuspensionDistance: 0.3 + m_ForceAppPointDistance: 0 + m_Mass: 20 + m_WheelDampingRate: 0.25 + m_ForwardFriction: + m_ExtremumSlip: 0.4 + m_ExtremumValue: 1 + m_AsymptoteSlip: 0.8 + m_AsymptoteValue: 0.5 + m_Stiffness: 1 + m_SidewaysFriction: + m_ExtremumSlip: 0.2 + m_ExtremumValue: 1 + m_AsymptoteSlip: 0.5 + m_AsymptoteValue: 0.75 + m_Stiffness: 1 + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_Enabled: 1 + m_ProvidesContacts: 0 +--- !u!114 &382105620855292410 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2159326893312496990} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 484c6bad1888141449bbccb931f4b3cf, type: 3} + m_Name: + m_EditorClassIdentifier: + wheelModel: {fileID: 652363909179142327} + WheelCollider: {fileID: 0} + steerable: 0 + motorized: 1 +--- !u!1 &2209096832116521880 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9160133666062122038} + - component: {fileID: 3495064740278155630} + - component: {fileID: 1366580333563430134} + m_Layer: 0 + m_Name: Wheel Front Left Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9160133666062122038 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2209096832116521880} + serializedVersion: 2 + m_LocalRotation: {x: -0.7071067, y: -0.000000030908616, z: 0.000000030908623, w: 0.7071068} + m_LocalPosition: {x: -0.77813995, y: -0.7559926, z: 0.9672816} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2301419002926063789} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!146 &3495064740278155630 +WheelCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2209096832116521880} + serializedVersion: 2 + m_Center: {x: 0, y: 0, z: 0} + m_Radius: 0.44 + m_SuspensionSpring: + spring: 35000 + damper: 4500 + targetPosition: 0.5 + m_SuspensionDistance: 0.3 + m_ForceAppPointDistance: 0 + m_Mass: 20 + m_WheelDampingRate: 0.25 + m_ForwardFriction: + m_ExtremumSlip: 0.4 + m_ExtremumValue: 1 + m_AsymptoteSlip: 0.8 + m_AsymptoteValue: 0.5 + m_Stiffness: 1 + m_SidewaysFriction: + m_ExtremumSlip: 0.2 + m_ExtremumValue: 1 + m_AsymptoteSlip: 0.5 + m_AsymptoteValue: 0.75 + m_Stiffness: 1 + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_Enabled: 1 + m_ProvidesContacts: 0 +--- !u!114 &1366580333563430134 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2209096832116521880} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 484c6bad1888141449bbccb931f4b3cf, type: 3} + m_Name: + m_EditorClassIdentifier: + wheelModel: {fileID: 2242921521379127059} + WheelCollider: {fileID: 0} + steerable: 1 + motorized: 1 +--- !u!1 &2594779292406879122 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5958815432865298350} + - component: {fileID: 1634687682331704717} + - component: {fileID: 2108260670150410153} + m_Layer: 0 + m_Name: Wheel Front Right Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5958815432865298350 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2594779292406879122} + serializedVersion: 2 + m_LocalRotation: {x: -0.7071067, y: -0.000000030908616, z: 0.000000030908623, w: 0.7071068} + m_LocalPosition: {x: 0.78276384, y: -0.7559926, z: 0.9672816} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2301419002926063789} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!146 &1634687682331704717 +WheelCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2594779292406879122} + serializedVersion: 2 + m_Center: {x: 0, y: 0, z: 0} + m_Radius: 0.44 + m_SuspensionSpring: + spring: 35000 + damper: 4500 + targetPosition: 0.5 + m_SuspensionDistance: 0.3 + m_ForceAppPointDistance: 0 + m_Mass: 20 + m_WheelDampingRate: 0.25 + m_ForwardFriction: + m_ExtremumSlip: 0.4 + m_ExtremumValue: 1 + m_AsymptoteSlip: 0.8 + m_AsymptoteValue: 0.5 + m_Stiffness: 1 + m_SidewaysFriction: + m_ExtremumSlip: 0.2 + m_ExtremumValue: 1 + m_AsymptoteSlip: 0.5 + m_AsymptoteValue: 0.75 + m_Stiffness: 1 + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_Enabled: 1 + m_ProvidesContacts: 0 +--- !u!114 &2108260670150410153 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2594779292406879122} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 484c6bad1888141449bbccb931f4b3cf, type: 3} + m_Name: + m_EditorClassIdentifier: + wheelModel: {fileID: 6922460415575005086} + WheelCollider: {fileID: 0} + steerable: 1 + motorized: 1 +--- !u!1 &3084156225461900438 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4546257140473070702} + - component: {fileID: 8721735635745565706} + - component: {fileID: 6523545568947694954} + - component: {fileID: 1058289878153525866} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4546257140473070702 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3084156225461900438} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.512, z: 0} + m_LocalScale: {x: 0.06444746, y: 0.06444746, z: 0.06444746} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5606622673997875603} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8721735635745565706 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3084156225461900438} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6523545568947694954 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3084156225461900438} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + 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!135 &1058289878153525866 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3084156225461900438} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &3698160007605631005 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8216349325289692503} + - component: {fileID: 4871527849271648250} + - component: {fileID: 8770128885416097925} + m_Layer: 0 + m_Name: Wheel Back Left Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8216349325289692503 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3698160007605631005} + serializedVersion: 2 + m_LocalRotation: {x: -0.7071067, y: -0.000000030908616, z: 0.000000030908623, w: 0.7071068} + m_LocalPosition: {x: -0.77813995, y: -0.7559926, z: -1.201448} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2301419002926063789} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!146 &4871527849271648250 +WheelCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3698160007605631005} + serializedVersion: 2 + m_Center: {x: 0, y: 0, z: 0} + m_Radius: 0.44 + m_SuspensionSpring: + spring: 35000 + damper: 4500 + targetPosition: 0.5 + m_SuspensionDistance: 0.3 + m_ForceAppPointDistance: 0 + m_Mass: 20 + m_WheelDampingRate: 0.25 + m_ForwardFriction: + m_ExtremumSlip: 0.4 + m_ExtremumValue: 1 + m_AsymptoteSlip: 0.8 + m_AsymptoteValue: 0.5 + m_Stiffness: 1 + m_SidewaysFriction: + m_ExtremumSlip: 0.2 + m_ExtremumValue: 1 + m_AsymptoteSlip: 0.5 + m_AsymptoteValue: 0.75 + m_Stiffness: 1 + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_Enabled: 1 + m_ProvidesContacts: 0 +--- !u!114 &8770128885416097925 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3698160007605631005} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 484c6bad1888141449bbccb931f4b3cf, type: 3} + m_Name: + m_EditorClassIdentifier: + wheelModel: {fileID: 4041197582719350564} + WheelCollider: {fileID: 0} + steerable: 0 + motorized: 1 +--- !u!1 &4063953290020255592 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5079964337687418743} + - component: {fileID: 8292022005708051369} + - component: {fileID: 8967486445516665087} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5079964337687418743 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4063953290020255592} + serializedVersion: 2 + m_LocalRotation: {x: 0.12831117, y: -0, z: -0, w: 0.99173397} + m_LocalPosition: {x: 0, y: 2.18, z: -6.78} + m_LocalScale: {x: 1, y: 1.1810253, z: 0.9176579} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2301419002926063789} + m_LocalEulerAnglesHint: {x: 14.744, y: 0, z: 0} +--- !u!20 &8292022005708051369 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4063953290020255592} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &8967486445516665087 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4063953290020255592} + m_Enabled: 1 +--- !u!1 &7538980336259591868 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1716496655553330213} + - component: {fileID: 3628323171342217674} + - component: {fileID: 6357741554398880948} + - component: {fileID: 3040473519983296419} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1716496655553330213 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7538980336259591868} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.01, y: 0.5, z: 0.01} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5606622673997875603} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3628323171342217674 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7538980336259591868} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6357741554398880948 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7538980336259591868} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + 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!136 &3040473519983296419 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7538980336259591868} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!1 &8876418123987428758 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5606622673997875603} + m_Layer: 0 + m_Name: Antenna Front + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5606622673997875603 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8876418123987428758} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.839, y: 0.305, z: 1.722} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1716496655553330213} + - {fileID: 4546257140473070702} + m_Father: {fileID: 2301419002926063789} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1763987318340880198 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + propertyPath: m_LocalPosition.y + value: 1.427 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + propertyPath: m_Name + value: car + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + insertIndex: 2 + addedObject: {fileID: 8216349325289692503} + - targetCorrespondingSourceObject: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + insertIndex: 4 + addedObject: {fileID: 7865009529694488039} + - targetCorrespondingSourceObject: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + insertIndex: 6 + addedObject: {fileID: 9160133666062122038} + - targetCorrespondingSourceObject: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + insertIndex: -1 + addedObject: {fileID: 5958815432865298350} + - targetCorrespondingSourceObject: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + insertIndex: -1 + addedObject: {fileID: 5079964337687418743} + - targetCorrespondingSourceObject: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + insertIndex: -1 + addedObject: {fileID: 5606622673997875603} + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + insertIndex: -1 + addedObject: {fileID: 2495061794352433422} + - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + insertIndex: -1 + addedObject: {fileID: 8588499819273421497} + - targetCorrespondingSourceObject: {fileID: -5287916851642620284, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + insertIndex: -1 + addedObject: {fileID: 2634568116272046903} + m_SourcePrefab: {fileID: 100100000, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} +--- !u!4 &652363909179142327 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1258572041014540273, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + m_PrefabInstance: {fileID: 1763987318340880198} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1493955717807061527 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + m_PrefabInstance: {fileID: 1763987318340880198} + m_PrefabAsset: {fileID: 0} +--- !u!54 &2495061794352433422 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1493955717807061527} + serializedVersion: 4 + m_Mass: 1500 + m_Drag: 0 + m_AngularDrag: 0.05 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &8588499819273421497 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1493955717807061527} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0665500128106154f8d28bace7476416, type: 3} + m_Name: + m_EditorClassIdentifier: + motorTorque: 2000 + brakeTorque: 5000 + maxSpeed: 20 + steeringRange: 30 + steeringRangeAtMaxSpeed: 10 + centreOfGravityOffset: -1 +--- !u!4 &2242921521379127059 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 529881195364821077, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + m_PrefabInstance: {fileID: 1763987318340880198} + m_PrefabAsset: {fileID: 0} +--- !u!4 &2301419002926063789 stripped +Transform: + m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + m_PrefabInstance: {fileID: 1763987318340880198} + m_PrefabAsset: {fileID: 0} +--- !u!1 &3379804999177118146 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: -5287916851642620284, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + m_PrefabInstance: {fileID: 1763987318340880198} + m_PrefabAsset: {fileID: 0} +--- !u!64 &2634568116272046903 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3379804999177118146} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: -2560919825813260400, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} +--- !u!4 &4041197582719350564 stripped +Transform: + m_CorrespondingSourceObject: {fileID: -6886066687445569438, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + m_PrefabInstance: {fileID: 1763987318340880198} + m_PrefabAsset: {fileID: 0} +--- !u!4 &6922460415575005086 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8677156704096194776, guid: cde3b92d14d0b0349b04a21a7734f7fd, type: 3} + m_PrefabInstance: {fileID: 1763987318340880198} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/Actors/Controllable/Car/Car.prefab.meta b/Assets/Actors/Controllable/Car/Car.prefab.meta new file mode 100644 index 0000000..01da47b --- /dev/null +++ b/Assets/Actors/Controllable/Car/Car.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 94e96c1233ba900499b10caf5eb67fdc +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Actors/Controllable/Car/Scripts.meta b/Assets/Actors/Controllable/Car/Scripts.meta new file mode 100644 index 0000000..0bf6102 --- /dev/null +++ b/Assets/Actors/Controllable/Car/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d025b431bae3507479f0831026e32c8e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Actors/Controllable/Car/Scripts/CarControl.cs b/Assets/Actors/Controllable/Car/Scripts/CarControl.cs new file mode 100644 index 0000000..e9f27b8 --- /dev/null +++ b/Assets/Actors/Controllable/Car/Scripts/CarControl.cs @@ -0,0 +1,93 @@ +using UnityEngine; + +public class CarControl : MonoBehaviour +{ + [Header("Car Properties")] + public float motorTorque = 2000f; + public float brakeTorque = 2000f; + public float maxSpeed = 20f; + public float steeringRange = 30f; + public float steeringRangeAtMaxSpeed = 10f; + public float centreOfGravityOffset = -1f; + + private WheelControl[] wheels; + private Rigidbody rigidBody; + + private CarInputActions carControls; // Reference to the new input system + + void Awake() + { + carControls = new CarInputActions(); // Initialize Input Actions + } + void OnEnable() + { + carControls.Enable(); + } + + void OnDisable() + { + carControls.Disable(); + } + + // Start is called before the first frame update + void Start() + { + rigidBody = GetComponent(); + + // Adjust center of mass to improve stability and prevent rolling + Vector3 centerOfMass = rigidBody.centerOfMass; + centerOfMass.y += centreOfGravityOffset; + rigidBody.centerOfMass = centerOfMass; + + // Get all wheel components attached to the car + wheels = GetComponentsInChildren(); + } + + // FixedUpdate is called at a fixed time interval + void FixedUpdate() + { + // Read the Vector2 input from the new Input System + Vector2 inputVector = carControls.Car.Movement.ReadValue(); + + // Get player input for acceleration and steering + float vInput = inputVector.y; // Forward/backward input + float hInput = inputVector.x; // Steering input + + // Calculate current speed along the car's forward axis + float forwardSpeed = Vector3.Dot(transform.forward, rigidBody.linearVelocity); + float speedFactor = Mathf.InverseLerp(0, maxSpeed, Mathf.Abs(forwardSpeed)); // Normalized speed factor + + // Reduce motor torque and steering at high speeds for better handling + float currentMotorTorque = Mathf.Lerp(motorTorque, 0, speedFactor); + float currentSteerRange = Mathf.Lerp(steeringRange, steeringRangeAtMaxSpeed, speedFactor); + + // Determine if the player is accelerating or trying to reverse + bool isAccelerating = Mathf.Sign(vInput) == Mathf.Sign(forwardSpeed); + + foreach (var wheel in wheels) + { + // Apply steering to wheels that support steering + if (wheel.steerable) + { + wheel.WheelCollider.steerAngle = hInput * currentSteerRange; + } + + if (isAccelerating) + { + // Apply torque to motorized wheels + if (wheel.motorized) + { + wheel.WheelCollider.motorTorque = vInput * currentMotorTorque; + } + // Release brakes when accelerating + wheel.WheelCollider.brakeTorque = 0f; + } + else + { + // Apply brakes when reversing direction + wheel.WheelCollider.motorTorque = 0f; + wheel.WheelCollider.brakeTorque = Mathf.Abs(vInput) * brakeTorque; + } + } + } +} diff --git a/Assets/Actors/Controllable/Car/Scripts/CarControl.cs.meta b/Assets/Actors/Controllable/Car/Scripts/CarControl.cs.meta new file mode 100644 index 0000000..828ac01 --- /dev/null +++ b/Assets/Actors/Controllable/Car/Scripts/CarControl.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0665500128106154f8d28bace7476416 \ No newline at end of file diff --git a/Assets/Actors/Controllable/Car/Scripts/CarInputActions.cs b/Assets/Actors/Controllable/Car/Scripts/CarInputActions.cs new file mode 100644 index 0000000..db0d2e9 --- /dev/null +++ b/Assets/Actors/Controllable/Car/Scripts/CarInputActions.cs @@ -0,0 +1,355 @@ +//------------------------------------------------------------------------------ +// +// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator +// version 1.14.0 +// from Assets/Car/CarInputActions.inputactions +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine.InputSystem; +using UnityEngine.InputSystem.Utilities; + +/// +/// Provides programmatic access to , , and instances defined in asset "Assets/Car/CarInputActions.inputactions". +/// +/// +/// This class is source generated and any manual edits will be discarded if the associated asset is reimported or modified. +/// +/// +/// +/// using namespace UnityEngine; +/// using UnityEngine.InputSystem; +/// +/// // Example of using an InputActionMap named "Player" from a UnityEngine.MonoBehaviour implementing callback interface. +/// public class Example : MonoBehaviour, MyActions.IPlayerActions +/// { +/// private MyActions_Actions m_Actions; // Source code representation of asset. +/// private MyActions_Actions.PlayerActions m_Player; // Source code representation of action map. +/// +/// void Awake() +/// { +/// m_Actions = new MyActions_Actions(); // Create asset object. +/// m_Player = m_Actions.Player; // Extract action map object. +/// m_Player.AddCallbacks(this); // Register callback interface IPlayerActions. +/// } +/// +/// void OnDestroy() +/// { +/// m_Actions.Dispose(); // Destroy asset object. +/// } +/// +/// void OnEnable() +/// { +/// m_Player.Enable(); // Enable all actions within map. +/// } +/// +/// void OnDisable() +/// { +/// m_Player.Disable(); // Disable all actions within map. +/// } +/// +/// #region Interface implementation of MyActions.IPlayerActions +/// +/// // Invoked when "Move" action is either started, performed or canceled. +/// public void OnMove(InputAction.CallbackContext context) +/// { +/// Debug.Log($"OnMove: {context.ReadValue<Vector2>()}"); +/// } +/// +/// // Invoked when "Attack" action is either started, performed or canceled. +/// public void OnAttack(InputAction.CallbackContext context) +/// { +/// Debug.Log($"OnAttack: {context.ReadValue<float>()}"); +/// } +/// +/// #endregion +/// } +/// +/// +public partial class @CarInputActions: IInputActionCollection2, IDisposable +{ + /// + /// Provides access to the underlying asset instance. + /// + public InputActionAsset asset { get; } + + /// + /// Constructs a new instance. + /// + public @CarInputActions() + { + asset = InputActionAsset.FromJson(@"{ + ""name"": ""CarInputActions"", + ""maps"": [ + { + ""name"": ""Car"", + ""id"": ""c19f950c-3a7a-4a76-8523-1aa6fe6fcc3f"", + ""actions"": [ + { + ""name"": ""Movement"", + ""type"": ""Value"", + ""id"": ""a3955e03-93cf-4eb3-aa7e-d47eb8f6589c"", + ""expectedControlType"": ""Vector2"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": true + } + ], + ""bindings"": [ + { + ""name"": ""2D Vector"", + ""id"": ""4acb7ca1-35a7-4da8-8538-b419114f937a"", + ""path"": ""2DVector"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Movement"", + ""isComposite"": true, + ""isPartOfComposite"": false + }, + { + ""name"": ""up"", + ""id"": ""7cf87b87-53dc-449a-a3c4-f2e1f37f588a"", + ""path"": ""/w"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Movement"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""6f7380e9-0226-4816-92cb-3d668bd040f9"", + ""path"": ""/s"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Movement"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""5bf6f0e5-ee39-410a-9997-d4ef3362d1a2"", + ""path"": ""/a"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Movement"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""e9e1e925-1395-4159-a82a-b359f9767e77"", + ""path"": ""/d"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Movement"", + ""isComposite"": false, + ""isPartOfComposite"": true + } + ] + } + ], + ""controlSchemes"": [] +}"); + // Car + m_Car = asset.FindActionMap("Car", throwIfNotFound: true); + m_Car_Movement = m_Car.FindAction("Movement", throwIfNotFound: true); + } + + ~@CarInputActions() + { + UnityEngine.Debug.Assert(!m_Car.enabled, "This will cause a leak and performance issues, CarInputActions.Car.Disable() has not been called."); + } + + /// + /// Destroys this asset and all associated instances. + /// + public void Dispose() + { + UnityEngine.Object.Destroy(asset); + } + + /// + public InputBinding? bindingMask + { + get => asset.bindingMask; + set => asset.bindingMask = value; + } + + /// + public ReadOnlyArray? devices + { + get => asset.devices; + set => asset.devices = value; + } + + /// + public ReadOnlyArray controlSchemes => asset.controlSchemes; + + /// + public bool Contains(InputAction action) + { + return asset.Contains(action); + } + + /// + public IEnumerator GetEnumerator() + { + return asset.GetEnumerator(); + } + + /// + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + public void Enable() + { + asset.Enable(); + } + + /// + public void Disable() + { + asset.Disable(); + } + + /// + public IEnumerable bindings => asset.bindings; + + /// + public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false) + { + return asset.FindAction(actionNameOrId, throwIfNotFound); + } + + /// + public int FindBinding(InputBinding bindingMask, out InputAction action) + { + return asset.FindBinding(bindingMask, out action); + } + + // Car + private readonly InputActionMap m_Car; + private List m_CarActionsCallbackInterfaces = new List(); + private readonly InputAction m_Car_Movement; + /// + /// Provides access to input actions defined in input action map "Car". + /// + public struct CarActions + { + private @CarInputActions m_Wrapper; + + /// + /// Construct a new instance of the input action map wrapper class. + /// + public CarActions(@CarInputActions wrapper) { m_Wrapper = wrapper; } + /// + /// Provides access to the underlying input action "Car/Movement". + /// + public InputAction @Movement => m_Wrapper.m_Car_Movement; + /// + /// Provides access to the underlying input action map instance. + /// + public InputActionMap Get() { return m_Wrapper.m_Car; } + /// + public void Enable() { Get().Enable(); } + /// + public void Disable() { Get().Disable(); } + /// + public bool enabled => Get().enabled; + /// + /// Implicitly converts an to an instance. + /// + public static implicit operator InputActionMap(CarActions set) { return set.Get(); } + /// + /// Adds , and callbacks provided via on all input actions contained in this map. + /// + /// Callback instance. + /// + /// If is null or have already been added this method does nothing. + /// + /// + public void AddCallbacks(ICarActions instance) + { + if (instance == null || m_Wrapper.m_CarActionsCallbackInterfaces.Contains(instance)) return; + m_Wrapper.m_CarActionsCallbackInterfaces.Add(instance); + @Movement.started += instance.OnMovement; + @Movement.performed += instance.OnMovement; + @Movement.canceled += instance.OnMovement; + } + + /// + /// Removes , and callbacks provided via on all input actions contained in this map. + /// + /// + /// Calling this method when have not previously been registered has no side-effects. + /// + /// + private void UnregisterCallbacks(ICarActions instance) + { + @Movement.started -= instance.OnMovement; + @Movement.performed -= instance.OnMovement; + @Movement.canceled -= instance.OnMovement; + } + + /// + /// Unregisters and unregisters all input action callbacks via . + /// + /// + public void RemoveCallbacks(ICarActions instance) + { + if (m_Wrapper.m_CarActionsCallbackInterfaces.Remove(instance)) + UnregisterCallbacks(instance); + } + + /// + /// Replaces all existing callback instances and previously registered input action callbacks associated with them with callbacks provided via . + /// + /// + /// If is null, calling this method will only unregister all existing callbacks but not register any new callbacks. + /// + /// + /// + /// + public void SetCallbacks(ICarActions instance) + { + foreach (var item in m_Wrapper.m_CarActionsCallbackInterfaces) + UnregisterCallbacks(item); + m_Wrapper.m_CarActionsCallbackInterfaces.Clear(); + AddCallbacks(instance); + } + } + /// + /// Provides a new instance referencing this action map. + /// + public CarActions @Car => new CarActions(this); + /// + /// Interface to implement callback methods for all input action callbacks associated with input actions defined by "Car" which allows adding and removing callbacks. + /// + /// + /// + public interface ICarActions + { + /// + /// Method invoked when associated input action "Movement" is either , or . + /// + /// + /// + /// + void OnMovement(InputAction.CallbackContext context); + } +} diff --git a/Assets/Actors/Controllable/Car/Scripts/CarInputActions.cs.meta b/Assets/Actors/Controllable/Car/Scripts/CarInputActions.cs.meta new file mode 100644 index 0000000..16fbaf7 --- /dev/null +++ b/Assets/Actors/Controllable/Car/Scripts/CarInputActions.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ce4bc8ceb06ac494c929dc2ee1148479 \ No newline at end of file diff --git a/Assets/Actors/Controllable/Car/Scripts/CarInputActions.inputactions b/Assets/Actors/Controllable/Car/Scripts/CarInputActions.inputactions new file mode 100644 index 0000000..1e3ffee --- /dev/null +++ b/Assets/Actors/Controllable/Car/Scripts/CarInputActions.inputactions @@ -0,0 +1,78 @@ +{ + "name": "CarInputActions", + "maps": [ + { + "name": "Car", + "id": "c19f950c-3a7a-4a76-8523-1aa6fe6fcc3f", + "actions": [ + { + "name": "Movement", + "type": "Value", + "id": "a3955e03-93cf-4eb3-aa7e-d47eb8f6589c", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + } + ], + "bindings": [ + { + "name": "2D Vector", + "id": "4acb7ca1-35a7-4da8-8538-b419114f937a", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Movement", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "7cf87b87-53dc-449a-a3c4-f2e1f37f588a", + "path": "/w", + "interactions": "", + "processors": "", + "groups": "", + "action": "Movement", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "6f7380e9-0226-4816-92cb-3d668bd040f9", + "path": "/s", + "interactions": "", + "processors": "", + "groups": "", + "action": "Movement", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "5bf6f0e5-ee39-410a-9997-d4ef3362d1a2", + "path": "/a", + "interactions": "", + "processors": "", + "groups": "", + "action": "Movement", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "e9e1e925-1395-4159-a82a-b359f9767e77", + "path": "/d", + "interactions": "", + "processors": "", + "groups": "", + "action": "Movement", + "isComposite": false, + "isPartOfComposite": true + } + ] + } + ], + "controlSchemes": [] +} \ No newline at end of file diff --git a/Assets/Actors/Controllable/Car/Scripts/CarInputActions.inputactions.meta b/Assets/Actors/Controllable/Car/Scripts/CarInputActions.inputactions.meta new file mode 100644 index 0000000..b6b6ad7 --- /dev/null +++ b/Assets/Actors/Controllable/Car/Scripts/CarInputActions.inputactions.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 686e90d9bee6e9d4cbff2ff59322f557 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} + generateWrapperCode: 1 + wrapperCodePath: + wrapperClassName: + wrapperCodeNamespace: diff --git a/Assets/Actors/Controllable/Car/Scripts/WheelControll.cs b/Assets/Actors/Controllable/Car/Scripts/WheelControll.cs new file mode 100644 index 0000000..5eebd94 --- /dev/null +++ b/Assets/Actors/Controllable/Car/Scripts/WheelControll.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +public class WheelControl : MonoBehaviour +{ + public Transform wheelModel; + + [HideInInspector] public WheelCollider WheelCollider; + + // Create properties for the CarControl script + // (You should enable/disable these via the + // Editor Inspector window) + public bool steerable; + public bool motorized; + + Vector3 position; + Quaternion rotation; + + // Start is called before the first frame update + private void Start() + { + WheelCollider = GetComponent(); + } + + // Update is called once per frame + void Update() + { + // Get the Wheel collider's world pose values and + // use them to set the wheel model's position and rotation + WheelCollider.GetWorldPose(out position, out rotation); + wheelModel.transform.position = position; + wheelModel.transform.rotation = rotation; + } +} diff --git a/Assets/Actors/Controllable/Car/Scripts/WheelControll.cs.meta b/Assets/Actors/Controllable/Car/Scripts/WheelControll.cs.meta new file mode 100644 index 0000000..2d9ae63 --- /dev/null +++ b/Assets/Actors/Controllable/Car/Scripts/WheelControll.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 484c6bad1888141449bbccb931f4b3cf \ No newline at end of file diff --git a/Assets/Actors/Controllable/Car/car_import_settings.fbx b/Assets/Actors/Controllable/Car/car_import_settings.fbx new file mode 100644 index 0000000..2e7f1e9 Binary files /dev/null and b/Assets/Actors/Controllable/Car/car_import_settings.fbx differ diff --git a/Assets/Actors/Controllable/Car/car_import_settings.fbx.meta b/Assets/Actors/Controllable/Car/car_import_settings.fbx.meta new file mode 100644 index 0000000..828ebbc --- /dev/null +++ b/Assets/Actors/Controllable/Car/car_import_settings.fbx.meta @@ -0,0 +1,117 @@ +fileFormatVersion: 2 +guid: cde3b92d14d0b0349b04a21a7734f7fd +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: [] + externalObjects: + - first: + type: UnityEngine:Texture2D + assembly: UnityEngine.CoreModule + name: Car Body + second: {fileID: 2800000, guid: 0601a27fa7aa1744287b8b9ea1308280, type: 3} + - first: + type: UnityEngine:Texture2D + assembly: UnityEngine.CoreModule + name: wheel + second: {fileID: 2800000, guid: 6369c12d002a1b348a0f853abe43a22d, type: 3} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Actors/Controllable/Car/wheel.jpg b/Assets/Actors/Controllable/Car/wheel.jpg new file mode 100644 index 0000000..7cb40d2 Binary files /dev/null and b/Assets/Actors/Controllable/Car/wheel.jpg differ diff --git a/Assets/Actors/Controllable/Car/wheel.jpg.meta b/Assets/Actors/Controllable/Car/wheel.jpg.meta new file mode 100644 index 0000000..aef8c9f --- /dev/null +++ b/Assets/Actors/Controllable/Car/wheel.jpg.meta @@ -0,0 +1,130 @@ +fileFormatVersion: 2 +guid: 6369c12d002a1b348a0f853abe43a22d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio.meta b/Assets/Audio.meta new file mode 100644 index 0000000..7b04f23 --- /dev/null +++ b/Assets/Audio.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 269fef9a0b9099f4e9851ed9ca214487 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Environment.meta b/Assets/Environment.meta new file mode 100644 index 0000000..99dabb3 --- /dev/null +++ b/Assets/Environment.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8f3bd779a0e23744f8693115a182cf67 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Game.meta b/Assets/Game.meta new file mode 100644 index 0000000..6006e57 --- /dev/null +++ b/Assets/Game.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 88bd268d62888df4da5cd59ab158551f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UI.meta b/Assets/UI.meta new file mode 100644 index 0000000..a4b7c7c --- /dev/null +++ b/Assets/UI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 694923a5d7732134fbad0f36dc1b65d6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: