diff --git a/Assets/Audio/defeat_zapsplat_multimedia_game_negative_lose_life_tone_17878.mp3 b/Assets/Audio/defeat_zapsplat_multimedia_game_negative_lose_life_tone_17878.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..df7e5cf25455f8223fba4e600b85d197ae8b1314 Binary files /dev/null and b/Assets/Audio/defeat_zapsplat_multimedia_game_negative_lose_life_tone_17878.mp3 differ diff --git a/Assets/Audio/defeat_zapsplat_multimedia_game_negative_lose_life_tone_17878.mp3.meta b/Assets/Audio/defeat_zapsplat_multimedia_game_negative_lose_life_tone_17878.mp3.meta new file mode 100644 index 0000000000000000000000000000000000000000..d776d147af1ec9c743e6ea74f9058dd63e068eb0 --- /dev/null +++ b/Assets/Audio/defeat_zapsplat_multimedia_game_negative_lose_life_tone_17878.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 4fdd7bf245be77b4585b01f571cebe67 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/victory_little_robot_sound_factory_Jingle_Win_Synth_00.mp3 b/Assets/Audio/victory_little_robot_sound_factory_Jingle_Win_Synth_00.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..25a397b8437c254d28268cdc3b7177ab483a2dbb Binary files /dev/null and b/Assets/Audio/victory_little_robot_sound_factory_Jingle_Win_Synth_00.mp3 differ diff --git a/Assets/Audio/victory_little_robot_sound_factory_Jingle_Win_Synth_00.mp3.meta b/Assets/Audio/victory_little_robot_sound_factory_Jingle_Win_Synth_00.mp3.meta new file mode 100644 index 0000000000000000000000000000000000000000..de8d222804575763bb388e50174b3d7cccaf7023 --- /dev/null +++ b/Assets/Audio/victory_little_robot_sound_factory_Jingle_Win_Synth_00.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 118cc320564142246b390333e7162cc5 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/GameManager.prefab b/Assets/Prefabs/GameManager.prefab index 90a57f0f0d032f7bcf760b434280fd7d91477aa1..646d87dad20588cd5b845ec18629835f48e2f063 100644 --- a/Assets/Prefabs/GameManager.prefab +++ b/Assets/Prefabs/GameManager.prefab @@ -1,5 +1,132 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!1 &10536061 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 10536062} + - component: {fileID: 10536063} + m_Layer: 0 + m_Name: VictoDefJukebox + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &10536062 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 10536061} + 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: 8843049163892511642} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!82 &10536063 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 10536061} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 0 + m_Volume: 0.1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 --- !u!1 &8843049163153765049 GameObject: m_ObjectHideFlags: 0 @@ -219,6 +346,7 @@ Transform: - {fileID: 8843049163153765045} - {fileID: 8843049164346990957} - {fileID: 8843049163181613577} + - {fileID: 10536062} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -243,17 +371,28 @@ MonoBehaviour: - {fileID: 8843049163181613583} matDefaite: {fileID: 2100000, guid: 93bf22314b2b7f9459b98d43d95da164, type: 2} matVictoire: {fileID: 2100000, guid: b991e54001a19cf4fb1500d1dd6205e5, type: 2} - tempsDeJeuRestant: 80 + tempsDeJeu: 90 + victorySound: {fileID: 8300000, guid: 118cc320564142246b390333e7162cc5, type: 3} + defeatSound: {fileID: 8300000, guid: 4fdd7bf245be77b4585b01f571cebe67, type: 3} + victoryDefeatAudioSource: {fileID: 10536063} + difficulty: 1 gameEnded: 0 - nbSecondesAttenteDebut: 2 + nbSecondesAttenteDebut: 5 boutonsFinDePartie: {fileID: 0} mannette1: {fileID: 0} mannette2: {fileID: 0} allHumanSpawners: - {fileID: 0} - {fileID: 0} + - {fileID: 0} canvasCountdownStart: {fileID: 0} textCountdownStart: {fileID: 0} + textFinDePartie1: {fileID: 0} + textFinDePartie2: {fileID: 0} + textFinDePartie3: {fileID: 0} + coutManaEclair: 20 + coutManaCaillou: 5 + coutManaAnimal: 5 --- !u!82 &1476464315 AudioSource: m_ObjectHideFlags: 0 @@ -266,9 +405,9 @@ AudioSource: OutputAudioMixerGroup: {fileID: 0} m_audioClip: {fileID: 8300000, guid: 1875d238f0cf2f94890fc872a163f2f8, type: 3} m_PlayOnAwake: 0 - m_Volume: 0.1 + m_Volume: 0.05 m_Pitch: 1 - Loop: 0 + Loop: 1 Mute: 0 Spatialize: 0 SpatializePostEffects: 0 diff --git a/Assets/Scenes/Rendu/SceneNormal.unity b/Assets/Scenes/Rendu/SceneNormal.unity index 05f80325612d4fb0880b1941ff7b070e2db37e73..1ca090f1b11accdea6bb8beb6af5c93b5949353b 100644 --- a/Assets/Scenes/Rendu/SceneNormal.unity +++ b/Assets/Scenes/Rendu/SceneNormal.unity @@ -2564,11 +2564,6 @@ PrefabInstance: propertyPath: m_Name value: GameManager objectReference: {fileID: 0} - - target: {fileID: 8843049163892511641, guid: a4d8a0feae766074e82fe6e3b759c29f, - type: 3} - propertyPath: allHumanSpawners.Array.size - value: 3 - objectReference: {fileID: 0} - target: {fileID: 8843049163892511641, guid: a4d8a0feae766074e82fe6e3b759c29f, type: 3} propertyPath: boutonsFinDePartie @@ -2594,6 +2589,11 @@ PrefabInstance: propertyPath: allHumanSpawners.Array.data[1] value: objectReference: {fileID: 816938592} + - target: {fileID: 8843049163892511641, guid: a4d8a0feae766074e82fe6e3b759c29f, + type: 3} + propertyPath: allHumanSpawners.Array.data[2] + value: + objectReference: {fileID: 919288394} - target: {fileID: 8843049163892511641, guid: a4d8a0feae766074e82fe6e3b759c29f, type: 3} propertyPath: canvasCountdownStart @@ -2604,16 +2604,6 @@ PrefabInstance: propertyPath: textCountdownStart value: objectReference: {fileID: 7381448146964574628} - - target: {fileID: 8843049163892511641, guid: a4d8a0feae766074e82fe6e3b759c29f, - type: 3} - propertyPath: nbSecondesAttenteDebut - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 8843049163892511641, guid: a4d8a0feae766074e82fe6e3b759c29f, - type: 3} - propertyPath: coutManaCaillou - value: 5 - objectReference: {fileID: 0} - target: {fileID: 8843049163892511641, guid: a4d8a0feae766074e82fe6e3b759c29f, type: 3} propertyPath: textFinDePartie1 @@ -2629,21 +2619,6 @@ PrefabInstance: propertyPath: textFinDePartie3 value: objectReference: {fileID: 1745823358} - - target: {fileID: 8843049163892511641, guid: a4d8a0feae766074e82fe6e3b759c29f, - type: 3} - propertyPath: tempsDeJeu - value: 90 - objectReference: {fileID: 0} - - target: {fileID: 8843049163892511641, guid: a4d8a0feae766074e82fe6e3b759c29f, - type: 3} - propertyPath: coutManaEclair - value: 20 - objectReference: {fileID: 0} - - target: {fileID: 8843049163892511641, guid: a4d8a0feae766074e82fe6e3b759c29f, - type: 3} - propertyPath: allHumanSpawners.Array.data[2] - value: - objectReference: {fileID: 919288394} - target: {fileID: 8843049163892511642, guid: a4d8a0feae766074e82fe6e3b759c29f, type: 3} propertyPath: m_LocalPosition.x @@ -2699,13 +2674,9 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 1476464315, guid: a4d8a0feae766074e82fe6e3b759c29f, type: 3} - propertyPath: Loop - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 1476464315, guid: a4d8a0feae766074e82fe6e3b759c29f, type: 3} + - target: {fileID: 10536063, guid: a4d8a0feae766074e82fe6e3b759c29f, type: 3} propertyPath: m_Volume - value: 0.05 + value: 0.3 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: a4d8a0feae766074e82fe6e3b759c29f, type: 3} diff --git a/Assets/Scripts/GameManagement/GameManager.cs b/Assets/Scripts/GameManagement/GameManager.cs index 7130c4781a527cb208c2066fc4fbe9c923e59f33..4573a13a185aaf72de4faf73b53839e88f1d4ee9 100644 --- a/Assets/Scripts/GameManagement/GameManager.cs +++ b/Assets/Scripts/GameManagement/GameManager.cs @@ -23,6 +23,10 @@ public class GameManager : MonoBehaviour // temps de jeu en secondes private float tempsDeJeuRestant; + public AudioClip victorySound; + public AudioClip defeatSound; + public AudioSource victoryDefeatAudioSource; + public enum Difficulty : int { Easy = 0, @@ -220,6 +224,10 @@ public class GameManager : MonoBehaviour allHumanSpawners[i].SetGameStarted(false); } + victoryDefeatAudioSource.volume = .5f; + victoryDefeatAudioSource.clip = victorySound; + victoryDefeatAudioSource.Play(); + boutonsFinDePartie.SetActive(true); mannette1.SetLaserOn(); mannette2.SetLaserOn(); @@ -240,6 +248,10 @@ public class GameManager : MonoBehaviour allHumanSpawners[i].SetGameStarted(false); } + victoryDefeatAudioSource.volume = .05f; + victoryDefeatAudioSource.clip = defeatSound; + victoryDefeatAudioSource.Play(); + boutonsFinDePartie.SetActive(true); mannette1.SetLaserOn(); mannette2.SetLaserOn(); @@ -280,5 +292,25 @@ public class GameManager : MonoBehaviour tempsDeJeuRestant -= Time.deltaTime; TestFinDePartie(); } + + /* + + // TEST : + if (Input.GetKeyDown(KeyCode.V)) + { + victoryDefeatAudioSource.volume = .5f; + victoryDefeatAudioSource.clip = victorySound; + victoryDefeatAudioSource.Play(); + } + // TEST : + if (Input.GetKeyDown(KeyCode.D)) + { + victoryDefeatAudioSource.volume = .05f; + victoryDefeatAudioSource.clip = defeatSound; + victoryDefeatAudioSource.Play(); + } + + */ + } } diff --git a/Assets/Scripts/Interactions/CustomOVRGrabber.cs b/Assets/Scripts/Interactions/CustomOVRGrabber.cs index d198ab5e72a51a9306e16e076f88e103765a3271..0210a4ba8f40c7bc1e7ccab2163bedecab0598de 100644 --- a/Assets/Scripts/Interactions/CustomOVRGrabber.cs +++ b/Assets/Scripts/Interactions/CustomOVRGrabber.cs @@ -349,7 +349,7 @@ public class CustomOVRGrabber : MonoBehaviour m_grabbedObj = GameObject.Instantiate( prefabsToSpawn[Random.Range(0,3)], closestGrabbable.transform.position, - Quaternion.Euler(0f, 0f, 0f)).GetComponent<CustomOVRGrabbable>(); + Quaternion.Euler(0f, gameObject.transform.rotation.y, 0f)).GetComponent<CustomOVRGrabbable>(); closestGrabbableCollider = closestGrabbable.GetComponent<BoxCollider>(); m_grabbedObj.GrabBegin(this, closestGrabbableCollider); } @@ -358,7 +358,7 @@ public class CustomOVRGrabber : MonoBehaviour m_grabbedObj = GameObject.Instantiate( prefabsToSpawn[3], closestGrabbable.transform.position, - Quaternion.Euler(0f, 0f, 0f)).GetComponent<CustomOVRGrabbable>(); + Quaternion.Euler(0f, gameObject.transform.rotation.y, 0f)).GetComponent<CustomOVRGrabbable>(); closestGrabbableCollider = closestGrabbable.GetComponent<BoxCollider>(); m_grabbedObj.GrabBegin(this, closestGrabbableCollider); } @@ -451,6 +451,10 @@ public class CustomOVRGrabber : MonoBehaviour grabbedRigidbody.transform.position = grabbablePosition; if (m_grabbedObj.CompareTag("Eclair")) grabbedRigidbody.transform.rotation = grabbableRotation; + else + { + grabbedRigidbody.transform.rotation = Quaternion.Euler(0f,grabbableRotation.y,0f); + } } else { @@ -458,6 +462,10 @@ public class CustomOVRGrabber : MonoBehaviour if(m_grabbedObj.CompareTag("Eclair")) grabbedRigidbody.MoveRotation(grabbableRotation); + else + { + grabbedRigidbody.MoveRotation(Quaternion.Euler(0f, grabbableRotation.y, 0f)); + } } }