From 180918b98f40d7979bcec14076e39d01bdd4414e Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 30 Jan 2022 18:00:20 +1100 Subject: [PATCH 1/3] Added audio --- ...t_Game_Deep_Dark_Dungeon_Ambience_Loop.wav | 3 ++ ...e_Deep_Dark_Dungeon_Ambience_Loop.wav.meta | 7 ++++ .../Sound/SFX/Postive_Game_Sound.wav | 3 ++ .../Sound/SFX/Postive_Game_Sound.wav.meta | 36 +++++++++++++++++++ Assets/Art Assets/Sound/SFX/Spikes.wav | 3 ++ Assets/Art Assets/Sound/SFX/Spikes.wav.meta | 36 +++++++++++++++++++ Assets/Art Assets/Sound/SFX/Subtle_Jump.wav | 3 ++ .../Art Assets/Sound/SFX/Subtle_Jump.wav.meta | 36 +++++++++++++++++++ Assets/Scenes/Official Levels/Level 1.unity | 4 +-- Assets/Scenes/Official Levels/Level 2.unity | 4 +-- Assets/Scenes/Official Levels/Level 3.unity | 4 +-- .../Character/CharacterInputController.cs | 22 ++++++++++-- 12 files changed, 152 insertions(+), 9 deletions(-) create mode 100644 Assets/Art Assets/Sound/Ancient_Game_Deep_Dark_Dungeon_Ambience_Loop.wav create mode 100644 Assets/Art Assets/Sound/Ancient_Game_Deep_Dark_Dungeon_Ambience_Loop.wav.meta create mode 100644 Assets/Art Assets/Sound/SFX/Postive_Game_Sound.wav create mode 100644 Assets/Art Assets/Sound/SFX/Postive_Game_Sound.wav.meta create mode 100644 Assets/Art Assets/Sound/SFX/Spikes.wav create mode 100644 Assets/Art Assets/Sound/SFX/Spikes.wav.meta create mode 100644 Assets/Art Assets/Sound/SFX/Subtle_Jump.wav create mode 100644 Assets/Art Assets/Sound/SFX/Subtle_Jump.wav.meta diff --git a/Assets/Art Assets/Sound/Ancient_Game_Deep_Dark_Dungeon_Ambience_Loop.wav b/Assets/Art Assets/Sound/Ancient_Game_Deep_Dark_Dungeon_Ambience_Loop.wav new file mode 100644 index 0000000..1ba424d --- /dev/null +++ b/Assets/Art Assets/Sound/Ancient_Game_Deep_Dark_Dungeon_Ambience_Loop.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1114e8a743d790c11233a122c2ea9b1ce2c463dd816aa4592758c2fbeec82e8 +size 18853784 diff --git a/Assets/Art Assets/Sound/Ancient_Game_Deep_Dark_Dungeon_Ambience_Loop.wav.meta b/Assets/Art Assets/Sound/Ancient_Game_Deep_Dark_Dungeon_Ambience_Loop.wav.meta new file mode 100644 index 0000000..5f7c656 --- /dev/null +++ b/Assets/Art Assets/Sound/Ancient_Game_Deep_Dark_Dungeon_Ambience_Loop.wav.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 26b05661b72f11741a80e5126f2256f2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Art Assets/Sound/SFX/Postive_Game_Sound.wav b/Assets/Art Assets/Sound/SFX/Postive_Game_Sound.wav new file mode 100644 index 0000000..0f8b734 --- /dev/null +++ b/Assets/Art Assets/Sound/SFX/Postive_Game_Sound.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e29e135e335aa626dcf3f3dd804a7848987486c5bfa6aebbf7256d748ce87b9a +size 263522 diff --git a/Assets/Art Assets/Sound/SFX/Postive_Game_Sound.wav.meta b/Assets/Art Assets/Sound/SFX/Postive_Game_Sound.wav.meta new file mode 100644 index 0000000..16a1052 --- /dev/null +++ b/Assets/Art Assets/Sound/SFX/Postive_Game_Sound.wav.meta @@ -0,0 +1,36 @@ +fileFormatVersion: 2 +guid: 25300bf305e2f6e49a92b4a22d34ad6b +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: + 4: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 3 + quality: 1 + conversionMode: 0 + 7: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Art Assets/Sound/SFX/Spikes.wav b/Assets/Art Assets/Sound/SFX/Spikes.wav new file mode 100644 index 0000000..b8d3d01 --- /dev/null +++ b/Assets/Art Assets/Sound/SFX/Spikes.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50671c6b1429be59a0344e11eaed82f267cf8ffb877c3d9dbde899d8952a4fcf +size 353536 diff --git a/Assets/Art Assets/Sound/SFX/Spikes.wav.meta b/Assets/Art Assets/Sound/SFX/Spikes.wav.meta new file mode 100644 index 0000000..678e5d1 --- /dev/null +++ b/Assets/Art Assets/Sound/SFX/Spikes.wav.meta @@ -0,0 +1,36 @@ +fileFormatVersion: 2 +guid: 3342524d5a4ccda4283d0a1afdaf6307 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: + 4: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 3 + quality: 1 + conversionMode: 0 + 7: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Art Assets/Sound/SFX/Subtle_Jump.wav b/Assets/Art Assets/Sound/SFX/Subtle_Jump.wav new file mode 100644 index 0000000..5133213 --- /dev/null +++ b/Assets/Art Assets/Sound/SFX/Subtle_Jump.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a88217cad562b5b463349dd78a2d8850743c285eb9652a070170e0e2524b2a9 +size 177602 diff --git a/Assets/Art Assets/Sound/SFX/Subtle_Jump.wav.meta b/Assets/Art Assets/Sound/SFX/Subtle_Jump.wav.meta new file mode 100644 index 0000000..3376970 --- /dev/null +++ b/Assets/Art Assets/Sound/SFX/Subtle_Jump.wav.meta @@ -0,0 +1,36 @@ +fileFormatVersion: 2 +guid: f299cdaedee0d3945af92005e838736c +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: + 4: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 3 + quality: 1 + conversionMode: 0 + 7: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Official Levels/Level 1.unity b/Assets/Scenes/Official Levels/Level 1.unity index a75a365..dc27739 100644 --- a/Assets/Scenes/Official Levels/Level 1.unity +++ b/Assets/Scenes/Official Levels/Level 1.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:48909cfdfdff4b6287c7302b6941ef885d2326cc8afa0d8b890c102a66d84f45 -size 173901 +oid sha256:81aa53e1624b2408f88f8edbe5d834a6ed6311b1e9ccf603dc9843d9c320e8fb +size 176902 diff --git a/Assets/Scenes/Official Levels/Level 2.unity b/Assets/Scenes/Official Levels/Level 2.unity index afe8439..2ed3fac 100644 --- a/Assets/Scenes/Official Levels/Level 2.unity +++ b/Assets/Scenes/Official Levels/Level 2.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8976e7bfaaf8b7db16471f90c4986d8365df7fefdae13f6440d76acff1834550 -size 1961573 +oid sha256:9739cb4b3169bc4331871638b6170517bc9831566074395a464dab4b9ba99209 +size 1964746 diff --git a/Assets/Scenes/Official Levels/Level 3.unity b/Assets/Scenes/Official Levels/Level 3.unity index 53a0964..dc8063e 100644 --- a/Assets/Scenes/Official Levels/Level 3.unity +++ b/Assets/Scenes/Official Levels/Level 3.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:02fc32aa23106e7ee4bae91009a0f0c3fe5841fc51753debff2aaf370151972d -size 591133 +oid sha256:9702cf532ec8bd87c68943206a88fef9afb2873652bd16d9ecd1e7b8093bd09e +size 594251 diff --git a/Assets/Scripts/Character/CharacterInputController.cs b/Assets/Scripts/Character/CharacterInputController.cs index 941e320..164356f 100644 --- a/Assets/Scripts/Character/CharacterInputController.cs +++ b/Assets/Scripts/Character/CharacterInputController.cs @@ -26,6 +26,15 @@ public class CharacterInputController : MonoBehaviour [SerializeField] private Animator m_animator; + [SerializeField] + private AudioClip m_DeathSound; + + [SerializeField] + private AudioClip m_VictoryClip; + + [SerializeField] + private AudioClip m_JumpSound; + [SerializeField, BoxGroup("Settings")] private float m_speed = 2.0f; @@ -73,25 +82,32 @@ public class CharacterInputController : MonoBehaviour public void OnLandHappened() { - m_animator.SetTrigger("Land"); + m_animator.SetTrigger("Land"); } public void OnJumpHappened() { m_animator.SetTrigger("Land"); + //AudioSource.PlayClipAtPoint(m_JumpSound, transform.position); } public void OnDeath(bool value) { - if (value) + if (value) + { m_animator.SetTrigger("Death"); + AudioSource.PlayClipAtPoint(m_DeathSound, transform.position); + } else m_animator.SetTrigger("Respawn"); } public void OnVictory(bool value) { - if (value) + if (value) + { m_animator.SetTrigger("Victory"); + AudioSource.PlayClipAtPoint(m_VictoryClip, transform.position); + } } From c84aa768e51c911cdf82d27f92ebbc4e55b236c2 Mon Sep 17 00:00:00 2001 From: jreason Date: Sun, 30 Jan 2022 18:01:21 +1100 Subject: [PATCH 2/3] Working monsters --- Assets/Scenes/MonsterWorking.unity | 3 ++ Assets/Scenes/MonsterWorking.unity.meta | 7 ++++ Assets/Scripts/LevelManager.cs | 2 +- Assets/Scripts/MonsterController.cs | 44 +++++++++++++++++++++---- 4 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 Assets/Scenes/MonsterWorking.unity create mode 100644 Assets/Scenes/MonsterWorking.unity.meta diff --git a/Assets/Scenes/MonsterWorking.unity b/Assets/Scenes/MonsterWorking.unity new file mode 100644 index 0000000..3ce746f --- /dev/null +++ b/Assets/Scenes/MonsterWorking.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abd6c264eebe98fefd6c2e4a013567caeb3864a117a6cc8d445d91145f6eb1de +size 110580 diff --git a/Assets/Scenes/MonsterWorking.unity.meta b/Assets/Scenes/MonsterWorking.unity.meta new file mode 100644 index 0000000..ddf9ec3 --- /dev/null +++ b/Assets/Scenes/MonsterWorking.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 72869211a51722a49b486c6163795717 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/LevelManager.cs b/Assets/Scripts/LevelManager.cs index f8c5414..d92c812 100644 --- a/Assets/Scripts/LevelManager.cs +++ b/Assets/Scripts/LevelManager.cs @@ -54,7 +54,7 @@ public class LevelManager : MonoBehaviour private void Start() { - m_allResetable = FindObjectsOfType().OfType().ToArray(); + m_allResetable = FindObjectsOfType(true).OfType().ToArray(); m_timer.Value = m_timeInLevel; m_isVictory.Value = false; diff --git a/Assets/Scripts/MonsterController.cs b/Assets/Scripts/MonsterController.cs index 3afb748..f321ccb 100644 --- a/Assets/Scripts/MonsterController.cs +++ b/Assets/Scripts/MonsterController.cs @@ -14,12 +14,16 @@ public class MonsterController : MonoBehaviour, IResettable private GameObject[] m_possibleFrames; - [SerializeField] private Transform m_player; + public GameObject m_defaultObject; + [SerializeField] + private float m_distance = 3; [SerializeField] - public GameObject m_defaultObject; + private Vector3 m_offset = Vector3.zero; + + private bool m_hasChanged = false; private void OnEnable() { @@ -33,6 +37,7 @@ public class MonsterController : MonoBehaviour, IResettable private void Start() { + m_player = GameObject.FindGameObjectWithTag("Player").transform; foreach (Transform child in transform) { if (child.gameObject.activeInHierarchy) @@ -53,14 +58,35 @@ public class MonsterController : MonoBehaviour, IResettable } } + private void ResetMonster() + { + foreach (Transform child in transform) + { + child.gameObject.SetActive(child.gameObject == m_defaultObject); + } + } + private void OnLightChange(float value) { - if (value <= 0) + float distanceToPlayer = Vector3.Distance(m_player.position, transform.position + m_offset); + + if (value <= 0.1 && distanceToPlayer < m_distance && !m_hasChanged) { + Debug.Log(distanceToPlayer); ChangeRandomMonster(); + m_hasChanged = true; + } + else if (value <= 0) + { + ResetMonster(); + } + if (value > 0.5) + { + m_hasChanged = false; } + } public void OnLevelLoad() @@ -75,9 +101,13 @@ public class MonsterController : MonoBehaviour, IResettable public void OnResetEnd() { - foreach (Transform child in transform) - { - child.gameObject.SetActive(child.gameObject == m_defaultObject); - } + ResetMonster(); + } + + + private void OnDrawGizmosSelected() + { + Gizmos.color = Color.yellow; + Gizmos.DrawWireSphere(transform.position + m_offset, m_distance); } } From aa575e39460d649716263869d0f0ba7171e27ef8 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 30 Jan 2022 18:03:27 +1100 Subject: [PATCH 3/3] Added audio --- Assets/Scenes/Official Levels/Level 1.unity | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scenes/Official Levels/Level 1.unity b/Assets/Scenes/Official Levels/Level 1.unity index 906ccbc..c7bd617 100644 --- a/Assets/Scenes/Official Levels/Level 1.unity +++ b/Assets/Scenes/Official Levels/Level 1.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dbd11fcd140d341bc5560d41f286869e472d90a7bde29399e000dec6d332f6fd -size 174240 +oid sha256:e4df5c033e44567f75b83984ed4c7eaee7192748c2c053035c56c6d9b53f2693 +size 174931