diff --git a/Assets/Prefabs/FirstPerson.prefab b/Assets/Prefabs/FirstPerson.prefab new file mode 100644 index 0000000..f305a16 --- /dev/null +++ b/Assets/Prefabs/FirstPerson.prefab @@ -0,0 +1,427 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &112876 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 434624} + - 20: {fileID: 2061712} + - 92: {fileID: 9239602} + - 124: {fileID: 12479126} + - 81: {fileID: 8101620} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &117402 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 426836} + - 114: {fileID: 11453604} + - 143: {fileID: 14323870} + - 54: {fileID: 5492406} + - 82: {fileID: 8283000} + m_Layer: 0 + m_Name: FirstPerson + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &167304 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 422960} + - 82: {fileID: 8225872} + m_Layer: 0 + m_Name: AudioSourceRespiration + m_TagString: AudioSourceBreath + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &422960 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 167304} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: .487160414, y: -.242959023, z: -5.49911785} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 426836} + m_RootOrder: 0 +--- !u!4 &426836 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 117402} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -.469999999, y: 2.1099999, z: 2.48688507} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 422960} + - {fileID: 434624} + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!4 &434624 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 112876} + 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: 426836} + m_RootOrder: 1 +--- !u!20 &2061712 +Camera: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 112876} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: .300000012 + 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: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: .0219999999 + m_StereoMirrorMode: 0 +--- !u!54 &5492406 +Rigidbody: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 117402} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: .0500000007 + m_UseGravity: 1 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!81 &8101620 +AudioListener: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 112876} + m_Enabled: 1 +--- !u!82 &8225872 +AudioSource: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 167304} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 +--- !u!82 &8283000 +AudioSource: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 117402} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 +--- !u!92 &9239602 +Behaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 112876} + m_Enabled: 1 +--- !u!114 &11453604 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 117402} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4bcce75dab8f540b797340354c772d8b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsWalking: 0 + m_NbrAllumettes: 10 + m_Briquets: + - {fileID: 11418934, guid: 303650e9a23c68a42876df290e9d7537, type: 2} + - {fileID: 11418934, guid: 303650e9a23c68a42876df290e9d7537, type: 2} + - {fileID: 11418934, guid: 303650e9a23c68a42876df290e9d7537, type: 2} + m_Allumettes: {fileID: 11455286, guid: bdd994d2c872c9e4d8601100f973be0d, type: 2} + m_WalkSpeed: 3 + m_RunSpeed: 10 + m_Stamina: 1000 + m_RunstepLenghten: .699999988 + m_JumpSpeed: 10 + m_StickToGroundForce: 10 + m_GravityMultiplier: 2 + m_MouseLook: + XSensitivity: 2 + YSensitivity: 2 + clampVerticalRotation: 1 + MinimumX: -90 + MaximumX: 90 + smooth: 0 + smoothTime: 5 + m_UseFovKick: 1 + m_FovKick: + Camera: {fileID: 0} + originalFov: 0 + FOVIncrease: 3 + TimeToIncrease: 1 + TimeToDecrease: 1 + IncreaseCurve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_UseHeadBob: 1 + m_HeadBob: + HorizontalBobRange: .100000001 + VerticalBobRange: .100000001 + Bobcurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: .5 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1.5 + value: -1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 2 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + VerticaltoHorizontalRatio: 1 + m_JumpBob: + BobDuration: .200000003 + BobAmount: .100000001 + m_StepInterval: 5 + m_FootstepSounds: + - {fileID: 8300000, guid: 42e65e088b3f4374e851b8dbd38f3df9, type: 3} + - {fileID: 8300000, guid: 8bc94ec6ed537e743b481638bdcd503d, type: 3} + m_JumpSound: {fileID: 8300000, guid: 5897aeed9b676024fbb8c694b421a861, type: 3} + m_LandSound: {fileID: 8300000, guid: 3b09d59f4499d45428baa7a21e954296, type: 3} + m_RespireSound: {fileID: 8300000, guid: 6336350fc2bc6e74185163c95a6485dc, type: 3} + m_NoStaminaSound: {fileID: 8300000, guid: 96ec8c58b35c5354e9d23061d25a23d6, type: 3} +--- !u!124 &12479126 +Behaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 112876} + m_Enabled: 1 +--- !u!143 &14323870 +CharacterController: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 117402} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Height: 1.79999995 + m_Radius: .5 + m_SlopeLimit: 45 + m_StepOffset: .300000012 + m_SkinWidth: .0799999982 + m_MinMoveDistance: 0 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 0} + propertyPath: m_TagString + value: AudioSourceBreath + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 117402} + m_IsPrefabParent: 1 diff --git a/Assets/Prefabs/FirstPerson.prefab.meta b/Assets/Prefabs/FirstPerson.prefab.meta new file mode 100644 index 0000000..6a99ebd --- /dev/null +++ b/Assets/Prefabs/FirstPerson.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e180da7fedba0004086c3f44426d29c5 +timeCreated: 1447000680 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/PatScene.unity b/Assets/Scenes/PatScene.unity index 09e3dd3..caf3ad4 100644 --- a/Assets/Scenes/PatScene.unity +++ b/Assets/Scenes/PatScene.unity @@ -466,7 +466,7 @@ Prefab: m_Modifications: - target: {fileID: 419770, guid: 69061867cac74f14badaa57b01070f97, type: 2} propertyPath: m_LocalPosition.x - value: -.185000002 + value: -.114 objectReference: {fileID: 0} - target: {fileID: 419770, guid: 69061867cac74f14badaa57b01070f97, type: 2} propertyPath: m_LocalPosition.y @@ -474,7 +474,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 419770, guid: 69061867cac74f14badaa57b01070f97, type: 2} propertyPath: m_LocalPosition.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 419770, guid: 69061867cac74f14badaa57b01070f97, type: 2} propertyPath: m_LocalRotation.x @@ -1282,7 +1282,7 @@ Transform: m_PrefabParentObject: {fileID: 400056, guid: 4fed9d0bf3595254ba35890c3fd49728, type: 3} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1416680805} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: 0, y: .469086319, z: 0, w: .883152306} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1.5, y: 1.5, z: 1.5} m_Children: @@ -2202,8 +2202,8 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1925818716} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: .75999999, y: -.709999979, z: 1.08000004} + m_LocalRotation: {x: 0, y: 1, z: 0, w: -1.62920685e-07} + m_LocalPosition: {x: .75999999, y: -.800000012, z: 1.08000004} m_LocalScale: {x: .349999994, y: .5, z: .100000001} m_Children: - {fileID: 2142871351} diff --git a/Assets/Scenes/maxScene.unity b/Assets/Scenes/maxScene.unity index fa328b6..cbf1584 100644 --- a/Assets/Scenes/maxScene.unity +++ b/Assets/Scenes/maxScene.unity @@ -127,310 +127,45 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 3135019c33394eb4f917b222e3ecbddb, type: 2} m_IsPrefabParent: 0 ---- !u!1 &1768239005 -GameObject: +--- !u!1001 &2023543146 +Prefab: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1768239006} - - 114: {fileID: 1768239010} - - 143: {fileID: 1768239009} - - 54: {fileID: 1768239008} - - 82: {fileID: 1768239007} - m_Layer: 0 - m_Name: FirstPerson - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1768239006 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1768239005} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: .545000017, z: -.409999996} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 1945388283} - m_Father: {fileID: 0} - m_RootOrder: 1 ---- !u!82 &1768239007 -AudioSource: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1768239005} - m_Enabled: 1 - serializedVersion: 4 - OutputAudioMixerGroup: {fileID: 0} - m_audioClip: {fileID: 0} - m_PlayOnAwake: 1 - m_Volume: 1 - m_Pitch: 1 - Loop: 0 - Mute: 0 - Spatialize: 0 - Priority: 128 - DopplerLevel: 1 - MinDistance: 1 - MaxDistance: 500 - Pan2D: 0 - rolloffMode: 0 - BypassEffects: 0 - BypassListenerEffects: 0 - BypassReverbZones: 0 - rolloffCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 426836, guid: e180da7fedba0004086c3f44426d29c5, type: 2} + propertyPath: m_LocalPosition.x + value: -.469999999 + objectReference: {fileID: 0} + - target: {fileID: 426836, guid: e180da7fedba0004086c3f44426d29c5, type: 2} + propertyPath: m_LocalPosition.y + value: 2.1099999 + objectReference: {fileID: 0} + - target: {fileID: 426836, guid: e180da7fedba0004086c3f44426d29c5, type: 2} + propertyPath: m_LocalPosition.z + value: 2.48688507 + objectReference: {fileID: 0} + - target: {fileID: 426836, guid: e180da7fedba0004086c3f44426d29c5, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 426836, guid: e180da7fedba0004086c3f44426d29c5, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 426836, guid: e180da7fedba0004086c3f44426d29c5, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 426836, guid: e180da7fedba0004086c3f44426d29c5, type: 2} + propertyPath: m_LocalRotation.w value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - - time: 1 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - panLevelCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - spreadCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - reverbZoneMixCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 + objectReference: {fileID: 0} + - target: {fileID: 426836, guid: e180da7fedba0004086c3f44426d29c5, type: 2} + propertyPath: m_RootOrder value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 ---- !u!54 &1768239008 -Rigidbody: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1768239005} - serializedVersion: 2 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: .0500000007 - m_UseGravity: 1 - m_IsKinematic: 1 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 ---- !u!143 &1768239009 -CharacterController: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1768239005} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Height: 1.79999995 - m_Radius: .5 - m_SlopeLimit: 45 - m_StepOffset: .300000012 - m_SkinWidth: .0799999982 - m_MinMoveDistance: 0 - m_Center: {x: 0, y: 0, z: 0} ---- !u!114 &1768239010 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1768239005} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4bcce75dab8f540b797340354c772d8b, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IsWalking: 0 - m_NbrAllumettes: 10 - m_Briquets: - - {fileID: 11418934, guid: 303650e9a23c68a42876df290e9d7537, type: 2} - - {fileID: 11418934, guid: 303650e9a23c68a42876df290e9d7537, type: 2} - - {fileID: 11418934, guid: 303650e9a23c68a42876df290e9d7537, type: 2} - m_Allumettes: {fileID: 11455286, guid: bdd994d2c872c9e4d8601100f973be0d, type: 2} - m_WalkSpeed: 0 - m_RunSpeed: 0 - m_Stamina: 1000 - m_RunstepLenghten: 0 - m_JumpSpeed: 0 - m_StickToGroundForce: 0 - m_GravityMultiplier: 0 - m_MouseLook: - XSensitivity: 2 - YSensitivity: 2 - clampVerticalRotation: 1 - MinimumX: -90 - MaximumX: 90 - smooth: 0 - smoothTime: 5 - m_UseFovKick: 0 - m_FovKick: - Camera: {fileID: 0} - originalFov: 0 - FOVIncrease: 3 - TimeToIncrease: 1 - TimeToDecrease: 1 - IncreaseCurve: - serializedVersion: 2 - m_Curve: [] - m_PreInfinity: 2 - m_PostInfinity: 2 - m_UseHeadBob: 0 - m_HeadBob: - HorizontalBobRange: .330000013 - VerticalBobRange: .330000013 - Bobcurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - - time: .5 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - - time: 1 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - - time: 1.5 - value: -1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - - time: 2 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - VerticaltoHorizontalRatio: 1 - m_JumpBob: - BobDuration: 0 - BobAmount: 0 - m_StepInterval: 0 - m_FootstepSounds: [] - m_JumpSound: {fileID: 0} - m_LandSound: {fileID: 0} ---- !u!1 &1945388278 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1945388283} - - 20: {fileID: 1945388282} - - 92: {fileID: 1945388281} - - 124: {fileID: 1945388280} - - 81: {fileID: 1945388279} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &1945388279 -AudioListener: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1945388278} - m_Enabled: 1 ---- !u!124 &1945388280 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1945388278} - m_Enabled: 1 ---- !u!92 &1945388281 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1945388278} - m_Enabled: 1 ---- !u!20 &1945388282 -Camera: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1945388278} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: .300000012 - 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: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 - m_StereoMirrorMode: 0 ---- !u!4 &1945388283 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1945388278} - 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: 1768239006} - m_RootOrder: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: e180da7fedba0004086c3f44426d29c5, type: 2} + m_IsPrefabParent: 0 diff --git a/Assets/Scripts/FirstPersonController.cs b/Assets/Scripts/FirstPersonController.cs index b00c05d..9620c38 100644 --- a/Assets/Scripts/FirstPersonController.cs +++ b/Assets/Scripts/FirstPersonController.cs @@ -31,6 +31,8 @@ namespace UnityStandardAssets.Characters.FirstPerson [SerializeField] private AudioClip[] m_FootstepSounds; // an array of footstep sounds that will be randomly selected from. [SerializeField] private AudioClip m_JumpSound; // the sound played when character leaves the ground. [SerializeField] private AudioClip m_LandSound; // the sound played when character touches back on ground. + [SerializeField] private AudioClip m_RespireSound; // the sound played when character touches back on ground. + [SerializeField] private AudioClip m_NoStaminaSound; // the sound played when character touches back on ground. private Camera m_Camera; private bool m_Jump; @@ -47,6 +49,7 @@ namespace UnityStandardAssets.Characters.FirstPerson private float m_NextStep; private bool m_Jumping; private AudioSource m_AudioSource; + private AudioSource m_AudioSourceChild; private MilesStonesPARA currentMilestone; // Use this for initialization @@ -62,6 +65,7 @@ namespace UnityStandardAssets.Characters.FirstPerson m_NextStep = m_StepCycle/2f; m_Jumping = false; m_AudioSource = GetComponent(); + m_AudioSourceChild = GameObject.FindGameObjectWithTag("AudioSourceBreath").GetComponent(); m_MouseLook.Init(transform , m_Camera.transform); } @@ -98,8 +102,46 @@ namespace UnityStandardAssets.Characters.FirstPerson m_AudioSource.Play(); m_NextStep = m_StepCycle + .5f; } - - + + private void PlayRespireSound() + { + bool changeSound; + if(Input.GetButton("StopRespire") && canSprint) + { + //Stopper la respiration et auguementer les sons + m_AudioSourceChild.volume -= 0.05f; + if(m_AudioSourceChild.volume <0) + m_AudioSourceChild.volume=0; + + } + else + { + //Repiration sounds + m_AudioSourceChild.volume += 0.3f; + if(m_AudioSourceChild.volume >1) + m_AudioSourceChild.volume=1; + } + if(m_Stamina < 100) + { + if(m_AudioSourceChild.clip == m_NoStaminaSound) + changeSound=false; + else + changeSound=true; + + m_AudioSourceChild.clip = m_NoStaminaSound; + } + else + { + if(m_AudioSourceChild.clip == m_RespireSound) + changeSound=false; + else + changeSound=true; + m_AudioSourceChild.clip = m_RespireSound; + } + if(changeSound || !m_AudioSourceChild.isPlaying) + m_AudioSourceChild.Play(); + m_NextStep = m_StepCycle + .5f; + } private void FixedUpdate() { float speed; @@ -115,7 +157,8 @@ namespace UnityStandardAssets.Characters.FirstPerson m_MoveDir.x = desiredMove.x*speed; m_MoveDir.z = desiredMove.z*speed; - + + PlayRespireSound(); //Actions joueur if(Input.GetButton("Briquet")) { @@ -182,14 +225,6 @@ namespace UnityStandardAssets.Characters.FirstPerson m_NbrAllumettes--; DestroyObject(GameObject.FindGameObjectWithTag("Allumettes")); } - - if(Input.GetButton("StopRespire")) - //Stopper la respiration et auguementer les sons - print("yo2"); - else - //Repiration sounds - print("yo3"); - if (m_CharacterController.isGrounded) { m_MoveDir.y = -m_StickToGroundForce; @@ -293,7 +328,7 @@ namespace UnityStandardAssets.Characters.FirstPerson // keep track of whether or not the character is walking or running m_IsWalking = !CrossPlatformInputManager.GetButton("Course"); //Si le joueur marche. Il reprend de l'énergie - if(m_IsWalking) + if(m_IsWalking && !Input.GetButton("StopRespire")) { m_Stamina += 5; if(m_Stamina >= 500) @@ -302,7 +337,7 @@ namespace UnityStandardAssets.Characters.FirstPerson m_Stamina = 1000; } //Sinon il court, mais il perd de l'énergie - else + else if(!m_IsWalking || Input.GetButton("StopRespire")) { m_Stamina -= 10; if(m_Stamina < 0) diff --git a/Assets/Scripts/FlickeringLight.cs b/Assets/Scripts/FlickeringLight.cs index 4870ff8..47c2b8c 100644 --- a/Assets/Scripts/FlickeringLight.cs +++ b/Assets/Scripts/FlickeringLight.cs @@ -13,8 +13,6 @@ public class FlickeringLight : MonoBehaviour float range = MaxIntensity - MinIntensity; float AverageIntensity = MinIntensity + range / 2; - Debug.Log(Mathf.Sin(Time.timeSinceLevelLoad)); - PointLight.intensity = Random.Range(MinIntensity, MaxIntensity); } } diff --git a/Assets/Sound.meta b/Assets/Sound.meta new file mode 100644 index 0000000..17aa381 --- /dev/null +++ b/Assets/Sound.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e2839cc8e19d8dc4098d710783dbac88 +folderAsset: yes +timeCreated: 1446922484 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sound/essoufflement-1.mp3 b/Assets/Sound/essoufflement-1.mp3 new file mode 100644 index 0000000..c8b506a Binary files /dev/null and b/Assets/Sound/essoufflement-1.mp3 differ diff --git a/Assets/Sound/essoufflement-1.mp3.meta b/Assets/Sound/essoufflement-1.mp3.meta new file mode 100644 index 0000000..cd2d798 --- /dev/null +++ b/Assets/Sound/essoufflement-1.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 96ec8c58b35c5354e9d23061d25a23d6 +timeCreated: 1446999672 +licenseType: Free +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sound/respire.mp3 b/Assets/Sound/respire.mp3 new file mode 100644 index 0000000..7d8d327 Binary files /dev/null and b/Assets/Sound/respire.mp3 differ diff --git a/Assets/Sound/respire.mp3.meta b/Assets/Sound/respire.mp3.meta new file mode 100644 index 0000000..cf11457 --- /dev/null +++ b/Assets/Sound/respire.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 9645d3b6fddbdd44387c0d6996512b2a +timeCreated: 1447002560 +licenseType: Free +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/FirstPersonController.cs b/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/FirstPersonController.cs new file mode 100644 index 0000000..fdebed7 --- /dev/null +++ b/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/FirstPersonController.cs @@ -0,0 +1,257 @@ +using System; +using UnityEngine; +using UnityStandardAssets.CrossPlatformInput; +using UnityStandardAssets.Utility; +using Random = UnityEngine.Random; + +namespace UnityStandardAssets.Characters.FirstPerson +{ + [RequireComponent(typeof (CharacterController))] + [RequireComponent(typeof (AudioSource))] + public class FirstPersonController : MonoBehaviour + { + [SerializeField] private bool m_IsWalking; + [SerializeField] private float m_WalkSpeed; + [SerializeField] private float m_RunSpeed; + [SerializeField] [Range(0f, 1f)] private float m_RunstepLenghten; + [SerializeField] private float m_JumpSpeed; + [SerializeField] private float m_StickToGroundForce; + [SerializeField] private float m_GravityMultiplier; + [SerializeField] private MouseLook m_MouseLook; + [SerializeField] private bool m_UseFovKick; + [SerializeField] private FOVKick m_FovKick = new FOVKick(); + [SerializeField] private bool m_UseHeadBob; + [SerializeField] private CurveControlledBob m_HeadBob = new CurveControlledBob(); + [SerializeField] private LerpControlledBob m_JumpBob = new LerpControlledBob(); + [SerializeField] private float m_StepInterval; + [SerializeField] private AudioClip[] m_FootstepSounds; // an array of footstep sounds that will be randomly selected from. + [SerializeField] private AudioClip m_JumpSound; // the sound played when character leaves the ground. + [SerializeField] private AudioClip m_LandSound; // the sound played when character touches back on ground. + + private Camera m_Camera; + private bool m_Jump; + private float m_YRotation; + private Vector2 m_Input; + private Vector3 m_MoveDir = Vector3.zero; + private CharacterController m_CharacterController; + private CollisionFlags m_CollisionFlags; + private bool m_PreviouslyGrounded; + private Vector3 m_OriginalCameraPosition; + private float m_StepCycle; + private float m_NextStep; + private bool m_Jumping; + private AudioSource m_AudioSource; + + // Use this for initialization + private void Start() + { + m_CharacterController = GetComponent(); + m_Camera = Camera.main; + m_OriginalCameraPosition = m_Camera.transform.localPosition; + m_FovKick.Setup(m_Camera); + m_HeadBob.Setup(m_Camera, m_StepInterval); + m_StepCycle = 0f; + m_NextStep = m_StepCycle/2f; + m_Jumping = false; + m_AudioSource = GetComponent(); + m_MouseLook.Init(transform , m_Camera.transform); + } + + + // Update is called once per frame + private void Update() + { + RotateView(); + // the jump state needs to read here to make sure it is not missed + if (!m_Jump) + { + m_Jump = CrossPlatformInputManager.GetButtonDown("Jump"); + } + + if (!m_PreviouslyGrounded && m_CharacterController.isGrounded) + { + StartCoroutine(m_JumpBob.DoBobCycle()); + PlayLandingSound(); + m_MoveDir.y = 0f; + m_Jumping = false; + } + if (!m_CharacterController.isGrounded && !m_Jumping && m_PreviouslyGrounded) + { + m_MoveDir.y = 0f; + } + + m_PreviouslyGrounded = m_CharacterController.isGrounded; + } + + + private void PlayLandingSound() + { + m_AudioSource.clip = m_LandSound; + m_AudioSource.Play(); + m_NextStep = m_StepCycle + .5f; + } + + + private void FixedUpdate() + { + float speed; + GetInput(out speed); + // always move along the camera forward as it is the direction that it being aimed at + Vector3 desiredMove = transform.forward*m_Input.y + transform.right*m_Input.x; + + // get a normal for the surface that is being touched to move along it + RaycastHit hitInfo; + Physics.SphereCast(transform.position, m_CharacterController.radius, Vector3.down, out hitInfo, + m_CharacterController.height/2f); + desiredMove = Vector3.ProjectOnPlane(desiredMove, hitInfo.normal).normalized; + + m_MoveDir.x = desiredMove.x*speed; + m_MoveDir.z = desiredMove.z*speed; + + + if (m_CharacterController.isGrounded) + { + m_MoveDir.y = -m_StickToGroundForce; + + if (m_Jump) + { + m_MoveDir.y = m_JumpSpeed; + PlayJumpSound(); + m_Jump = false; + m_Jumping = true; + } + } + else + { + m_MoveDir += Physics.gravity*m_GravityMultiplier*Time.fixedDeltaTime; + } + m_CollisionFlags = m_CharacterController.Move(m_MoveDir*Time.fixedDeltaTime); + + ProgressStepCycle(speed); + UpdateCameraPosition(speed); + } + + + private void PlayJumpSound() + { + m_AudioSource.clip = m_JumpSound; + m_AudioSource.Play(); + } + + + private void ProgressStepCycle(float speed) + { + if (m_CharacterController.velocity.sqrMagnitude > 0 && (m_Input.x != 0 || m_Input.y != 0)) + { + m_StepCycle += (m_CharacterController.velocity.magnitude + (speed*(m_IsWalking ? 1f : m_RunstepLenghten)))* + Time.fixedDeltaTime; + } + + if (!(m_StepCycle > m_NextStep)) + { + return; + } + + m_NextStep = m_StepCycle + m_StepInterval; + + PlayFootStepAudio(); + } + + + private void PlayFootStepAudio() + { + if (!m_CharacterController.isGrounded) + { + return; + } + // pick & play a random footstep sound from the array, + // excluding sound at index 0 + int n = Random.Range(1, m_FootstepSounds.Length); + m_AudioSource.clip = m_FootstepSounds[n]; + m_AudioSource.PlayOneShot(m_AudioSource.clip); + // move picked sound to index 0 so it's not picked next time + m_FootstepSounds[n] = m_FootstepSounds[0]; + m_FootstepSounds[0] = m_AudioSource.clip; + } + + + private void UpdateCameraPosition(float speed) + { + Vector3 newCameraPosition; + if (!m_UseHeadBob) + { + return; + } + if (m_CharacterController.velocity.magnitude > 0 && m_CharacterController.isGrounded) + { + m_Camera.transform.localPosition = + m_HeadBob.DoHeadBob(m_CharacterController.velocity.magnitude + + (speed*(m_IsWalking ? 1f : m_RunstepLenghten))); + newCameraPosition = m_Camera.transform.localPosition; + newCameraPosition.y = m_Camera.transform.localPosition.y - m_JumpBob.Offset(); + } + else + { + newCameraPosition = m_Camera.transform.localPosition; + newCameraPosition.y = m_OriginalCameraPosition.y - m_JumpBob.Offset(); + } + m_Camera.transform.localPosition = newCameraPosition; + } + + + private void GetInput(out float speed) + { + // Read input + float horizontal = CrossPlatformInputManager.GetAxis("Horizontal"); + float vertical = CrossPlatformInputManager.GetAxis("Vertical"); + + bool waswalking = m_IsWalking; + +#if !MOBILE_INPUT + // On standalone builds, walk/run speed is modified by a key press. + // keep track of whether or not the character is walking or running + m_IsWalking = !Input.GetKey(KeyCode.LeftShift); +#endif + // set the desired speed to be walking or running + speed = m_IsWalking ? m_WalkSpeed : m_RunSpeed; + m_Input = new Vector2(horizontal, vertical); + + // normalize input if it exceeds 1 in combined length: + if (m_Input.sqrMagnitude > 1) + { + m_Input.Normalize(); + } + + // handle speed change to give an fov kick + // only if the player is going to a run, is running and the fovkick is to be used + if (m_IsWalking != waswalking && m_UseFovKick && m_CharacterController.velocity.sqrMagnitude > 0) + { + StopAllCoroutines(); + StartCoroutine(!m_IsWalking ? m_FovKick.FOVKickUp() : m_FovKick.FOVKickDown()); + } + } + + + private void RotateView() + { + m_MouseLook.LookRotation (transform, m_Camera.transform); + } + + + private void OnControllerColliderHit(ControllerColliderHit hit) + { + Rigidbody body = hit.collider.attachedRigidbody; + //dont move the rigidbody if the character is on top of it + if (m_CollisionFlags == CollisionFlags.Below) + { + return; + } + + if (body == null || body.isKinematic) + { + return; + } + body.AddForceAtPosition(m_CharacterController.velocity*0.1f, hit.point, ForceMode.Impulse); + } + } +} diff --git a/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/FirstPersonController.cs.meta b/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/FirstPersonController.cs.meta new file mode 100644 index 0000000..437171c --- /dev/null +++ b/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/FirstPersonController.cs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 05ec5cf00ca181d45a42ba1870e148c3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: diff --git a/Assets/Standard Assets/Characters/PhysicsMaterials.meta b/Assets/Standard Assets/Characters/PhysicsMaterials.meta new file mode 100644 index 0000000..b7766b3 --- /dev/null +++ b/Assets/Standard Assets/Characters/PhysicsMaterials.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ea2a5216ffb8d4b319d09e8d7782120c +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset index 164349d..89fcf42 100644 --- a/ProjectSettings/InputManager.asset +++ b/ProjectSettings/InputManager.asset @@ -235,7 +235,7 @@ InputManager: descriptiveNegativeName: negativeButton: positiveButton: joystick button 9 - altNegativeButton: space + altNegativeButton: c altPositiveButton: gravity: 1000 dead: .00100000005 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index e040c5c..b11ab9b 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 5.2.0f3 +m_EditorVersion: 5.2.2f1 m_StandardAssetsVersion: 0 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 176c2c8..a6bf378 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -5,6 +5,10 @@ TagManager: serializedVersion: 2 tags: - Trap + - Briquet + - MilesStones + - Allumettes + - AudioSourceBreath layers: - Default - TransparentFX