diff --git a/Assets/Blender/bucheronAnimationControler_repare.controller b/Assets/Blender/bucheronAnimationControler_repare.controller index 89aab7a27b5677ddac854130cbaac21d1350c5fb..08810599f96ad588382e90d98ca72812ec9b5ac0 100644 --- a/Assets/Blender/bucheronAnimationControler_repare.controller +++ b/Assets/Blender/bucheronAnimationControler_repare.controller @@ -203,7 +203,7 @@ AnimatorController: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: bucheronAnimationControler + m_Name: bucheronAnimationControler_repare serializedVersion: 5 m_AnimatorParameters: - m_Name: Die @@ -211,25 +211,25 @@ AnimatorController: m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: Strike m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: Idle m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} - m_Name: Walk m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 1 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer diff --git a/Assets/Prefabs/SpawnersAndUnits/AnimalSpawnerAPoserLeVrai.prefab b/Assets/Prefabs/SpawnersAndUnits/AnimalSpawnerAPoserLeVrai.prefab index 6420cd99f64fe58f0f03d4448abc04e3bd22bb45..6cf7d3823e99b68ea55e0abe2a2bdf9dc8290d01 100644 --- a/Assets/Prefabs/SpawnersAndUnits/AnimalSpawnerAPoserLeVrai.prefab +++ b/Assets/Prefabs/SpawnersAndUnits/AnimalSpawnerAPoserLeVrai.prefab @@ -306,6 +306,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: locked: 0 + coutAnimal: 5 + coutCaillou: 5 clipFail: {fileID: 8300000, guid: d041115870f45b94fbe082a394febe96, type: 3} --- !u!1001 &4863508889398085587 PrefabInstance: @@ -327,7 +329,7 @@ PrefabInstance: - target: {fileID: -927199367670048503, guid: 985ea245f3670f64c9dc3d0ca6215866, type: 3} propertyPath: m_TagString - value: Placeable + value: PlaceableAnimal objectReference: {fileID: 0} - target: {fileID: -4216859302048453862, guid: 985ea245f3670f64c9dc3d0ca6215866, type: 3} diff --git a/Assets/Prefabs/SpawnersAndUnits/Bucheron Variant.prefab b/Assets/Prefabs/SpawnersAndUnits/Bucheron Variant.prefab index 988824dd3d00e5bca7cc880b553cbaee35729415..f74eb1058a4b93d9f3fc5d8232d0cc84a993ad83 100644 --- a/Assets/Prefabs/SpawnersAndUnits/Bucheron Variant.prefab +++ b/Assets/Prefabs/SpawnersAndUnits/Bucheron Variant.prefab @@ -24,8 +24,8 @@ AudioSource: serializedVersion: 4 OutputAudioMixerGroup: {fileID: 0} m_audioClip: {fileID: 8300000, guid: 5daa6c3424c02344b99081d63fb53ab5, type: 3} - m_PlayOnAwake: 1 - m_Volume: 1 + m_PlayOnAwake: 0 + m_Volume: 0.6 m_Pitch: 1 Loop: 0 Mute: 0 diff --git a/Assets/Prefabs/SpawnersAndUnits/CaillouAPoser_1.prefab b/Assets/Prefabs/SpawnersAndUnits/CaillouAPoser_1.prefab index 13c95c84eb88212fc23f01dfc26655483d834479..eff28706361ba322ac6e4d506ff42d5f8a03c2be 100644 --- a/Assets/Prefabs/SpawnersAndUnits/CaillouAPoser_1.prefab +++ b/Assets/Prefabs/SpawnersAndUnits/CaillouAPoser_1.prefab @@ -276,6 +276,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: locked: 0 + coutAnimal: 5 + coutCaillou: 5 clipFail: {fileID: 8300000, guid: d041115870f45b94fbe082a394febe96, type: 3} --- !u!1001 &893203079023456205 PrefabInstance: @@ -292,7 +294,7 @@ PrefabInstance: - target: {fileID: -927199367670048503, guid: 467583d4ee8d9564bacf5bde7844a76d, type: 3} propertyPath: m_TagString - value: Placeable + value: PlaceableRock objectReference: {fileID: 0} - target: {fileID: -4216859302048453862, guid: 467583d4ee8d9564bacf5bde7844a76d, type: 3} diff --git a/Assets/Prefabs/SpawnersAndUnits/CaillouAPoser_2.prefab b/Assets/Prefabs/SpawnersAndUnits/CaillouAPoser_2.prefab index 356f1b4350d6b4c90e2d423d89d394271364701c..04d27877116005520989ffd0ce1b6f5e00d8a680 100644 --- a/Assets/Prefabs/SpawnersAndUnits/CaillouAPoser_2.prefab +++ b/Assets/Prefabs/SpawnersAndUnits/CaillouAPoser_2.prefab @@ -322,6 +322,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: locked: 0 + coutAnimal: 5 + coutCaillou: 5 clipFail: {fileID: 8300000, guid: d041115870f45b94fbe082a394febe96, type: 3} --- !u!1001 &893203079023456205 PrefabInstance: @@ -343,7 +345,7 @@ PrefabInstance: - target: {fileID: -927199367670048503, guid: 467583d4ee8d9564bacf5bde7844a76d, type: 3} propertyPath: m_TagString - value: Placeable + value: PlaceableRock objectReference: {fileID: 0} - target: {fileID: -4216859302048453862, guid: 467583d4ee8d9564bacf5bde7844a76d, type: 3} diff --git a/Assets/Prefabs/SpawnersAndUnits/CaillouAPoser_3.prefab b/Assets/Prefabs/SpawnersAndUnits/CaillouAPoser_3.prefab index 99b7aecd959e7eefccf65a44845f2a540ac6bbf8..27bba0a83721f0dd51d38d27cef7532d9d67c1ad 100644 --- a/Assets/Prefabs/SpawnersAndUnits/CaillouAPoser_3.prefab +++ b/Assets/Prefabs/SpawnersAndUnits/CaillouAPoser_3.prefab @@ -322,6 +322,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: locked: 0 + coutAnimal: 5 + coutCaillou: 5 clipFail: {fileID: 8300000, guid: d041115870f45b94fbe082a394febe96, type: 3} --- !u!1001 &893203079023456205 PrefabInstance: @@ -343,7 +345,7 @@ PrefabInstance: - target: {fileID: -927199367670048503, guid: 467583d4ee8d9564bacf5bde7844a76d, type: 3} propertyPath: m_TagString - value: Placeable + value: PlaceableRock objectReference: {fileID: 0} - target: {fileID: -4216859302048453862, guid: 467583d4ee8d9564bacf5bde7844a76d, type: 3} diff --git a/Assets/Prefabs/SpawnersAndUnits/humanSpawn Variant.prefab b/Assets/Prefabs/SpawnersAndUnits/humanSpawn Variant.prefab index 7839d0aeeba35db8cbf19e9aabb8ea64c4b45c80..30c47816ce71725070294eca06097ba19aa5c8f0 100644 --- a/Assets/Prefabs/SpawnersAndUnits/humanSpawn Variant.prefab +++ b/Assets/Prefabs/SpawnersAndUnits/humanSpawn Variant.prefab @@ -60,7 +60,7 @@ AudioSource: OutputAudioMixerGroup: {fileID: 0} m_audioClip: {fileID: 8300000, guid: 2b5a54c82ee95914f83c12391f812fce, type: 3} m_PlayOnAwake: 0 - m_Volume: 0.3 + m_Volume: 0.9 m_Pitch: 1 Loop: 0 Mute: 0 diff --git a/Assets/Prefabs/SpawnersAndUnits/rock1 Variant.prefab b/Assets/Prefabs/SpawnersAndUnits/rock1 Variant.prefab index 4b32195ac38d2494d37095f223e84efde196580b..3796d0757bab3e01c1dd0037698d493e44a963df 100644 --- a/Assets/Prefabs/SpawnersAndUnits/rock1 Variant.prefab +++ b/Assets/Prefabs/SpawnersAndUnits/rock1 Variant.prefab @@ -276,6 +276,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: locked: 0 + coutAnimal: 5 + coutCaillou: 5 clipFail: {fileID: 8300000, guid: d041115870f45b94fbe082a394febe96, type: 3} --- !u!1001 &893203079023456205 PrefabInstance: diff --git a/Assets/Scenes/Plou/SceneDeJeu.unity b/Assets/Scenes/Plou/SceneDeJeu.unity index ab1dde0e372b62f51bec00c82c1b715d534bc61e..3722a89c7f07d2fd0b9d8f06118a5142e9dc17f6 100644 --- a/Assets/Scenes/Plou/SceneDeJeu.unity +++ b/Assets/Scenes/Plou/SceneDeJeu.unity @@ -2669,6 +2669,41 @@ PrefabInstance: propertyPath: m_Name value: DemoMovementPrefab objectReference: {fileID: 0} + - target: {fileID: 7877475419188864622, guid: 40b53501a36d4d44fb4cd3f334ea9e21, + type: 3} + propertyPath: prefabsToSpawn.Array.size + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 7877475419188864622, guid: 40b53501a36d4d44fb4cd3f334ea9e21, + type: 3} + propertyPath: prefabsToSpawn.Array.data[1] + value: + objectReference: {fileID: 9170637679517578948, guid: 3f473ecd8e3f30a4c86e4803b5d45c31, + type: 3} + - target: {fileID: 7877475419188864622, guid: 40b53501a36d4d44fb4cd3f334ea9e21, + type: 3} + propertyPath: prefabsToSpawn.Array.data[0] + value: + objectReference: {fileID: 9170637679517578948, guid: e55a2a935238c364f922d923d3c81938, + type: 3} + - target: {fileID: 7877475419188864622, guid: 40b53501a36d4d44fb4cd3f334ea9e21, + type: 3} + propertyPath: prefabsToSpawn.Array.data[3] + value: + objectReference: {fileID: 3485586581573099226, guid: 40da07e2d806d8a4b9734eece14c7f29, + type: 3} + - target: {fileID: 7877475419188864622, guid: 40b53501a36d4d44fb4cd3f334ea9e21, + type: 3} + propertyPath: prefabsToSpawn.Array.data[4] + value: + objectReference: {fileID: 1635955774121567605, guid: fb70591c0585bd44aa382e89fe9fe10f, + type: 3} + - target: {fileID: 7877475419188864622, guid: 40b53501a36d4d44fb4cd3f334ea9e21, + type: 3} + propertyPath: prefabsToSpawn.Array.data[2] + value: + objectReference: {fileID: 9170637679517578948, guid: 00bb07c734e570b4aa4bb763e3644188, + type: 3} - target: {fileID: 703763750751559496, guid: 40b53501a36d4d44fb4cd3f334ea9e21, type: 3} propertyPath: m_LocalPosition.x @@ -2734,41 +2769,6 @@ PrefabInstance: propertyPath: m_playerBounds value: objectReference: {fileID: 1008236114} - - target: {fileID: 7877475419188864622, guid: 40b53501a36d4d44fb4cd3f334ea9e21, - type: 3} - propertyPath: prefabsToSpawn.Array.size - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 7877475419188864622, guid: 40b53501a36d4d44fb4cd3f334ea9e21, - type: 3} - propertyPath: prefabsToSpawn.Array.data[1] - value: - objectReference: {fileID: 9170637679517578948, guid: 3f473ecd8e3f30a4c86e4803b5d45c31, - type: 3} - - target: {fileID: 7877475419188864622, guid: 40b53501a36d4d44fb4cd3f334ea9e21, - type: 3} - propertyPath: prefabsToSpawn.Array.data[0] - value: - objectReference: {fileID: 9170637679517578948, guid: e55a2a935238c364f922d923d3c81938, - type: 3} - - target: {fileID: 7877475419188864622, guid: 40b53501a36d4d44fb4cd3f334ea9e21, - type: 3} - propertyPath: prefabsToSpawn.Array.data[3] - value: - objectReference: {fileID: 3485586581573099226, guid: 40da07e2d806d8a4b9734eece14c7f29, - type: 3} - - target: {fileID: 7877475419188864622, guid: 40b53501a36d4d44fb4cd3f334ea9e21, - type: 3} - propertyPath: prefabsToSpawn.Array.data[4] - value: - objectReference: {fileID: 1635955774121567605, guid: fb70591c0585bd44aa382e89fe9fe10f, - type: 3} - - target: {fileID: 7877475419188864622, guid: 40b53501a36d4d44fb4cd3f334ea9e21, - type: 3} - propertyPath: prefabsToSpawn.Array.data[2] - value: - objectReference: {fileID: 9170637679517578948, guid: 00bb07c734e570b4aa4bb763e3644188, - type: 3} - target: {fileID: 4636063900629700414, guid: 40b53501a36d4d44fb4cd3f334ea9e21, type: 3} propertyPath: m_Name @@ -2978,6 +2978,16 @@ PrefabInstance: propertyPath: m_Pivot.y value: 0.5 objectReference: {fileID: 0} + - target: {fileID: 631740407303268463, guid: 19f8f72e5dadfc64eaff2141fb7a5428, + type: 3} + propertyPath: m_LocalScale.x + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 631740407303268463, guid: 19f8f72e5dadfc64eaff2141fb7a5428, + type: 3} + propertyPath: m_LocalScale.z + value: 1.2 + objectReference: {fileID: 0} - target: {fileID: 8841424690919089444, guid: 19f8f72e5dadfc64eaff2141fb7a5428, type: 3} propertyPath: gameManager @@ -2993,16 +3003,6 @@ PrefabInstance: propertyPath: m_SizeDelta.y value: 50 objectReference: {fileID: 0} - - target: {fileID: 631740407303268463, guid: 19f8f72e5dadfc64eaff2141fb7a5428, - type: 3} - propertyPath: m_LocalScale.x - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 631740407303268463, guid: 19f8f72e5dadfc64eaff2141fb7a5428, - type: 3} - propertyPath: m_LocalScale.z - value: 1.2 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 19f8f72e5dadfc64eaff2141fb7a5428, type: 3} --- !u!1001 &8780046436246757025 @@ -3126,6 +3126,11 @@ PrefabInstance: propertyPath: nbSecondesAttenteDebut value: 5 objectReference: {fileID: 0} + - target: {fileID: 8843049163892511641, guid: a4d8a0feae766074e82fe6e3b759c29f, + type: 3} + propertyPath: coutManaCaillou + value: 10 + objectReference: {fileID: 0} - target: {fileID: 8843049163892511642, guid: a4d8a0feae766074e82fe6e3b759c29f, type: 3} propertyPath: m_LocalPosition.x diff --git a/Assets/Scripts/CustomOVRGrabbable.cs b/Assets/Scripts/CustomOVRGrabbable.cs index 6297d67e0b7a71a3bd980548efbf535318fef2da..7d620b5628a5f89d526efec4c0327e4eb57e7d73 100644 --- a/Assets/Scripts/CustomOVRGrabbable.cs +++ b/Assets/Scripts/CustomOVRGrabbable.cs @@ -131,7 +131,7 @@ public class CustomOVRGrabbable : MonoBehaviour Rigidbody rb = gameObject.GetComponent<Rigidbody>(); rb.isKinematic = m_grabbedKinematic; - if (!(gameObject.CompareTag("Placeable") || gameObject.CompareTag("Eclair"))){ + if (!(gameObject.CompareTag("PlaceableRock") || gameObject.CompareTag("PlaceableAnimal") || gameObject.CompareTag("Eclair"))){ rb.velocity = linearVelocity; rb.angularVelocity = angularVelocity; } diff --git a/Assets/Scripts/CustomOVRGrabber.cs b/Assets/Scripts/CustomOVRGrabber.cs index 65a171403448c901e0883c182eb3190c357143aa..2537e639c57ec3e2532a69dda7edef02f78c286d 100644 --- a/Assets/Scripts/CustomOVRGrabber.cs +++ b/Assets/Scripts/CustomOVRGrabber.cs @@ -346,7 +346,7 @@ public class CustomOVRGrabber : MonoBehaviour else if (closestGrabbable.CompareTag("InHandAnimalSpawner")) { m_grabbedObj = GameObject.Instantiate( - prefabsToSpawn[1], + prefabsToSpawn[3], closestGrabbable.transform.position, Quaternion.Euler(0f, 0f, 0f)).GetComponent<CustomOVRGrabbable>(); closestGrabbableCollider = closestGrabbable.GetComponent<BoxCollider>(); @@ -355,7 +355,7 @@ public class CustomOVRGrabber : MonoBehaviour else if (closestGrabbable.CompareTag("EclairSpawner")) { m_grabbedObj = GameObject.Instantiate( - prefabsToSpawn[2], + prefabsToSpawn[4], closestGrabbable.transform.position, gameObject.transform.rotation).GetComponent<CustomOVRGrabbable>(); closestGrabbableCollider = closestGrabbable.GetComponent<BoxCollider>(); @@ -373,7 +373,7 @@ public class CustomOVRGrabber : MonoBehaviour m_grabbedObj.GrabBegin(this, closestGrabbableCollider); } - if (m_grabbedObj.CompareTag("Placeable") || m_grabbedObj.CompareTag("Eclair")) + if (m_grabbedObj.CompareTag("PlaceableRock") || m_grabbedObj.CompareTag("PlaceableAnimal") || m_grabbedObj.CompareTag("Eclair")) { m_grabbedObj.SendMessage("AfficherLignePose"); } @@ -477,7 +477,7 @@ public class CustomOVRGrabber : MonoBehaviour SetPlayerIgnoreCollision(m_grabbedObj.gameObject, false); // check si c'est un pĂ´sable - if (m_grabbedObj.CompareTag("Placeable")) + if (m_grabbedObj.CompareTag("PlaceableRock") || m_grabbedObj.CompareTag("PlaceableAnimal")) { m_grabbedObj.GetComponent<Posable>().PoserLeCube(); } else if (m_grabbedObj.CompareTag("Eclair")) { diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 7e96afe60118bef202b23aa319db8c437cae0bb9..472c79b78774ccdec9df922c96b8e4a08c759664 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -45,6 +45,19 @@ public class GameManager : MonoBehaviour // true apres X secondes private static bool gameStarted = false; + //Cout des pouvoirs + private static float staticoutEclair; + private static float staticoutCaillou; + private static float staticoutAnimal; + + [SerializeField] private float coutManaEclair = 30f; + [SerializeField] private float coutManaCaillou = 5f; + [SerializeField] private float coutManaAnimal = 5f; + + public static float CoutManaEclair() => staticoutEclair; + public static float CoutManaCaillou() => staticoutCaillou; + public static float CoutManaAnimal() => staticoutAnimal; + public static bool HasGameStartedYetPlease() { return gameStarted; @@ -53,6 +66,10 @@ public class GameManager : MonoBehaviour // Start is called before the first frame update void Start() { + staticoutEclair = coutManaEclair ; + staticoutCaillou = coutManaCaillou; + staticoutAnimal = coutManaAnimal; + musicScene = gameObject.GetComponent<AudioSource>(); audioCountdown = canvasCountdownStart.GetComponent<AudioSource>(); secondsToWait = nbSecondesAttenteDebut; diff --git a/Assets/Scripts/Lancable.cs b/Assets/Scripts/Lancable.cs index 2bf7ff46927100a31966db654378f8800c43c1af..552ea86ef103e737c30f4713b722ad4646cd8584 100644 --- a/Assets/Scripts/Lancable.cs +++ b/Assets/Scripts/Lancable.cs @@ -14,7 +14,7 @@ public class Lancable : MonoBehaviour private Transform lanceurTransform; - [SerializeField] private static float coutEclair = 30f; + [SerializeField] private float coutEclair = 30f; public AudioClip clipFail; @@ -28,6 +28,8 @@ public class Lancable : MonoBehaviour // Start is called before the first frame update void Start() { + coutEclair = GameManager.CoutManaEclair(); + myaudiosource = gameObject.GetComponent<AudioSource>(); layerAvecToutSaufCeluiAIgnorer = ~layerAvecToutSaufCeluiAIgnorer; lineRenderPose = GetComponent<LineRenderer>(); diff --git a/Assets/Scripts/Posable.cs b/Assets/Scripts/Posable.cs index 357d43fabe85747194d02f31665bcdb1f10c1b86..f6f3e7a346101702173f67d9f5b64c5fa31b6e08 100644 --- a/Assets/Scripts/Posable.cs +++ b/Assets/Scripts/Posable.cs @@ -12,6 +12,11 @@ public class Posable : MonoBehaviour private LineRenderer lineRenderPose; + //cout animal et caillou + + [SerializeField] private float coutAnimal = 5f; + [SerializeField] private float coutCaillou = 5f; + public AudioClip clipFail; @@ -20,6 +25,9 @@ public class Posable : MonoBehaviour // Start is called before the first frame update void Start() { + coutAnimal = GameManager.CoutManaAnimal(); + coutCaillou = GameManager.CoutManaCaillou(); + myaudiosource = gameObject.GetComponent<AudioSource>(); layerAvecToutSaufCeluiAIgnorer = ~layerAvecToutSaufCeluiAIgnorer; lineRenderPose = GetComponent<LineRenderer>(); @@ -56,9 +64,22 @@ public class Posable : MonoBehaviour if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.down), out hit, 100, layerAvecToutSaufCeluiAIgnorer)) { - GameObject trucSurLequelOnPose = hit.collider.gameObject; - if (trucSurLequelOnPose.CompareTag("GameBoard")) + GameObject trucSurLequelOnPose = hit.collider.gameObject; + + float coutPosable = 0f; + if (gameObject.CompareTag("PlaceableRock")) { + coutPosable = coutCaillou; + } + else if (gameObject.CompareTag("PlaceableAnimal")) + { + coutPosable = coutAnimal; + } + + if (trucSurLequelOnPose.CompareTag("GameBoard") && GameManager.ManaAmount() >= coutPosable) + { + GameManager.AddMana(-coutPosable); + gameObject.transform.position = new Vector3 (gameObject.transform.position.x, //hit.point.y + gameObject.transform.localScale.y/2, diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index cee6be7a71c2b81defe27338f376fb23c8b6d44f..71276d420c5cca159a75f44fdca4a563a1faf267 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -22,6 +22,8 @@ TagManager: - ButtonQuitGame - ButtonOptionsGame - ChoppedTree + - PlaceableRock + - PlaceableAnimal layers: - Default - TransparentFX