feat : music manager v0.1
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96957698beb0cde40958afe8c82ae312
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41c7d5fed07c6e94a92f7adc69ee286a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d1277029ea2a2542ae9d3f57e79d11c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1df8e6ca6d990e64c9916e4c68d45078
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &6521978618824486866
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4395560298612109037}
|
||||
- component: {fileID: 4908846766475971086}
|
||||
m_Layer: 0
|
||||
m_Name: AudioManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4395560298612109037
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6521978618824486866}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 228.87709, y: -0, z: -18.45408}
|
||||
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!114 &4908846766475971086
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6521978618824486866}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 53583b7aad5dc7044bbd6c7946fe6999, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Audio_AudioManager
|
||||
MusicGlobal_Menu:
|
||||
idInternal: 0
|
||||
valueGuidInternal:
|
||||
groupIdInternal: 0
|
||||
groupGuidInternal:
|
||||
WwiseObjectReference: {fileID: 11400000, guid: eb4dfa45e524daf448fb24b29d5d77c5, type: 2}
|
||||
MusicGlobal_Sane:
|
||||
idInternal: 0
|
||||
valueGuidInternal:
|
||||
groupIdInternal: 0
|
||||
groupGuidInternal:
|
||||
WwiseObjectReference: {fileID: 11400000, guid: 4789a3fef5f157040949777cea0ed1ea, type: 2}
|
||||
MusicGlobal_Staircase:
|
||||
idInternal: 0
|
||||
valueGuidInternal:
|
||||
groupIdInternal: 0
|
||||
groupGuidInternal:
|
||||
WwiseObjectReference: {fileID: 11400000, guid: eb0824f00dc43854ba3d7b51ba2df675, type: 2}
|
||||
MusicGlobal_Mad:
|
||||
idInternal: 0
|
||||
valueGuidInternal:
|
||||
groupIdInternal: 0
|
||||
groupGuidInternal:
|
||||
WwiseObjectReference: {fileID: 11400000, guid: e3fcce2a1fc421a4796cdb37b13bc843, type: 2}
|
||||
MusicGlobal_None:
|
||||
idInternal: 0
|
||||
valueGuidInternal:
|
||||
groupIdInternal: 0
|
||||
groupGuidInternal:
|
||||
WwiseObjectReference: {fileID: 11400000, guid: 2c9174fc93d599240a7b67774e57a52a, type: 2}
|
||||
PlayMusic:
|
||||
idInternal: 0
|
||||
valueGuidInternal:
|
||||
WwiseObjectReference: {fileID: 0}
|
||||
StopMusic:
|
||||
idInternal: 0
|
||||
valueGuidInternal:
|
||||
WwiseObjectReference: {fileID: 0}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 61f7fe4128138164295ef34aae4f6659
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,100 @@
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
|
||||
public enum WwiseMusicState { Menu, Sane, Staircase, Mad, None};
|
||||
public class Audio_AudioManager : MonoBehaviour
|
||||
{
|
||||
public static Audio_AudioManager Instance;
|
||||
|
||||
private bool isInitialized = false;
|
||||
|
||||
|
||||
|
||||
[Header("Music State variables")]
|
||||
[SerializeField] private AK.Wwise.State MusicGlobal_Menu;
|
||||
[SerializeField] private AK.Wwise.State MusicGlobal_Sane;
|
||||
[SerializeField] private AK.Wwise.State MusicGlobal_Staircase;
|
||||
[SerializeField] private AK.Wwise.State MusicGlobal_Mad;
|
||||
[SerializeField] private AK.Wwise.State MusicGlobal_None;
|
||||
|
||||
private WwiseMusicState currentMusicState;
|
||||
|
||||
[Header("Wwise Music Events")]
|
||||
public AK.Wwise.Event PlayMusic;
|
||||
public AK.Wwise.Event StopMusic;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
SetWwiseMusicState(WwiseMusicState.Sane); //Need to switch if we have a menu music.
|
||||
|
||||
PlayMusic.Post(gameObject);
|
||||
}
|
||||
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
//Singleton Logic
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this;
|
||||
DontDestroyOnLoad(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("AudioManager already exist! Destroying new ibnstance.");
|
||||
Destroy(this);
|
||||
}
|
||||
|
||||
if (isInitialized)
|
||||
{
|
||||
isInitialized = true;
|
||||
}
|
||||
|
||||
SetWwiseMusicState(WwiseMusicState.None);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void SetWwiseMusicState(WwiseMusicState MusicState)
|
||||
{
|
||||
if (MusicState == currentMusicState)
|
||||
{
|
||||
Debug.Log("MusicState is already" + MusicState + ".");
|
||||
return;
|
||||
}
|
||||
switch (MusicState)
|
||||
{
|
||||
default:
|
||||
case (WwiseMusicState.Menu):
|
||||
MusicGlobal_Menu.SetValue();
|
||||
break;
|
||||
case (WwiseMusicState.Sane):
|
||||
MusicGlobal_Sane.SetValue();
|
||||
break;
|
||||
case (WwiseMusicState.Staircase):
|
||||
MusicGlobal_Staircase.SetValue();
|
||||
break;
|
||||
case (WwiseMusicState.Mad):
|
||||
MusicGlobal_Mad.SetValue();
|
||||
break;
|
||||
case (WwiseMusicState.None):
|
||||
MusicGlobal_None.SetValue();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
Debug.Log("New Wwise MusicState" + MusicState + ".");
|
||||
|
||||
currentMusicState = MusicState;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53583b7aad5dc7044bbd6c7946fe6999
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1d007b5c796a6f849857373c498520b3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9491db930667d4846980e5427e434e6f, type: 3}
|
||||
m_Name: 5EE95D9E-014E-4A9E-880A-F1EEF0FE8D8C
|
||||
m_EditorClassIdentifier: AK.Wwise.Unity.API.WwiseTypes::WwiseStateReference
|
||||
objectName: inStaircase
|
||||
id: 3708394339
|
||||
guid: 5EE95D9E-014E-4A9E-880A-F1EEF0FE8D8C
|
||||
WwiseStateGroupReference: {fileID: 0}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb0824f00dc43854ba3d7b51ba2df675
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9491db930667d4846980e5427e434e6f, type: 3}
|
||||
m_Name: 8952F29F-BE73-473A-9D08-8294D37259E7
|
||||
m_EditorClassIdentifier: AK.Wwise.Unity.API.WwiseTypes::WwiseStateReference
|
||||
objectName: inMenu
|
||||
id: 3374585465
|
||||
guid: 8952F29F-BE73-473A-9D08-8294D37259E7
|
||||
WwiseStateGroupReference: {fileID: 0}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb4dfa45e524daf448fb24b29d5d77c5
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9491db930667d4846980e5427e434e6f, type: 3}
|
||||
m_Name: AA82CE06-EC15-4AB6-A59B-BEDE7C5926C7
|
||||
m_EditorClassIdentifier: AK.Wwise.Unity.API.WwiseTypes::WwiseStateReference
|
||||
objectName: None
|
||||
id: 748895195
|
||||
guid: AA82CE06-EC15-4AB6-A59B-BEDE7C5926C7
|
||||
WwiseStateGroupReference: {fileID: 0}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2c9174fc93d599240a7b67774e57a52a
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9491db930667d4846980e5427e434e6f, type: 3}
|
||||
m_Name: D325E2E9-6F95-4BA9-AF05-2C2E653106FA
|
||||
m_EditorClassIdentifier: AK.Wwise.Unity.API.WwiseTypes::WwiseStateReference
|
||||
objectName: inSane
|
||||
id: 3719846035
|
||||
guid: D325E2E9-6F95-4BA9-AF05-2C2E653106FA
|
||||
WwiseStateGroupReference: {fileID: 0}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4789a3fef5f157040949777cea0ed1ea
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9491db930667d4846980e5427e434e6f, type: 3}
|
||||
m_Name: DD04671B-E8B5-4B1A-986A-579728855F92
|
||||
m_EditorClassIdentifier: AK.Wwise.Unity.API.WwiseTypes::WwiseStateReference
|
||||
objectName: inMad
|
||||
id: 1174700730
|
||||
guid: DD04671B-E8B5-4B1A-986A-579728855F92
|
||||
WwiseStateGroupReference: {fileID: 0}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3fcce2a1fc421a4796cdb37b13bc843
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7232e08b392010b45b8b1c1fd25c4d6d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0aa59343b87f7aa4b869d883949b65c9, type: 3}
|
||||
m_Name: AF6D98B3-10FC-46F3-AFDB-665063E78DF8
|
||||
m_EditorClassIdentifier: AK.Wwise.Unity.API.WwiseTypes::WwiseStateGroupReference
|
||||
objectName: musicGlobal
|
||||
id: 1499314831
|
||||
guid: AF6D98B3-10FC-46F3-AFDB-665063E78DF8
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea33e74510b6ef84bbdde2121f209e13
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user