From dce16ef2351ed3675f42f887db21e8bf3acbb58a Mon Sep 17 00:00:00 2001 From: kimrdd Date: Sun, 4 Feb 2024 04:48:33 +0100 Subject: [PATCH] music stuff --- Assets/Scenes/GameScene.unity | 4 +- Assets/Scenes/MainMenu.unity | 45 +++++++++++++++++++ Assets/Scripts/Enemy/EnemyAnimationHandler.cs | 1 + Assets/Scripts/Misc/MainMenuMusic.cs | 11 +++++ Assets/Scripts/Misc/MainMenuMusic.cs.meta | 11 +++++ 5 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 Assets/Scripts/Misc/MainMenuMusic.cs create mode 100644 Assets/Scripts/Misc/MainMenuMusic.cs.meta diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index fcc5753..1387dc9 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -1551,7 +1551,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: StepInterval: 0.8 - Volume: 0.25 + Volume: 1 --- !u!1 &1377274208 GameObject: m_ObjectHideFlags: 0 @@ -3225,7 +3225,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: StepInterval: 0.8 - Volume: 0.25 + Volume: 1 --- !u!1 &1600052931 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/MainMenu.unity b/Assets/Scenes/MainMenu.unity index e21514d..b588516 100644 --- a/Assets/Scenes/MainMenu.unity +++ b/Assets/Scenes/MainMenu.unity @@ -954,6 +954,50 @@ Animation: m_PlayAutomatically: 1 m_AnimatePhysics: 0 m_CullingType: 0 +--- !u!1 &576358554 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 576358556} + - component: {fileID: 576358555} + m_Layer: 0 + m_Name: Sounds + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &576358555 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 576358554} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 040287643b9fdae4095a418d31927fde, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &576358556 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 576358554} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -14.201913, y: -13.266354, z: 10.06106} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &595937125 GameObject: m_ObjectHideFlags: 0 @@ -2141,3 +2185,4 @@ SceneRoots: - {fileID: 2132464283} - {fileID: 1304688535} - {fileID: 2057478380} + - {fileID: 576358556} diff --git a/Assets/Scripts/Enemy/EnemyAnimationHandler.cs b/Assets/Scripts/Enemy/EnemyAnimationHandler.cs index 647479f..583e8bf 100644 --- a/Assets/Scripts/Enemy/EnemyAnimationHandler.cs +++ b/Assets/Scripts/Enemy/EnemyAnimationHandler.cs @@ -42,6 +42,7 @@ public class EnemyAnimationHandler : MonoBehaviour public void Die() { animator.SetTrigger("Die"); + AudioManager.PlaySound("Slice_Enemy_SFX", transform.position).volume = 0.65f; } public void DestroyGameobject() { diff --git a/Assets/Scripts/Misc/MainMenuMusic.cs b/Assets/Scripts/Misc/MainMenuMusic.cs new file mode 100644 index 0000000..0655f09 --- /dev/null +++ b/Assets/Scripts/Misc/MainMenuMusic.cs @@ -0,0 +1,11 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class MainMenuMusic : MonoBehaviour +{ + void Start() + { + AudioManager.PlaySound("", new Vector3(0f, 0f, 0f)).volume = 1f; + } +} diff --git a/Assets/Scripts/Misc/MainMenuMusic.cs.meta b/Assets/Scripts/Misc/MainMenuMusic.cs.meta new file mode 100644 index 0000000..4662991 --- /dev/null +++ b/Assets/Scripts/Misc/MainMenuMusic.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 040287643b9fdae4095a418d31927fde +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: