wip : akRoom Tansition in theater
This commit is contained in:
@@ -32,34 +32,30 @@ public class Audio_AudioManager : MonoBehaviour
|
||||
// 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.
|
||||
// Guard against the duplicate running Start() before it's destroyed
|
||||
if (Instance != this) return;
|
||||
|
||||
SetWwiseMusicState(WwiseMusicState.Sane);
|
||||
PlayMusic.Post(gameObject);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
//Singleton Logic
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this;
|
||||
DontDestroyOnLoad(this);
|
||||
DontDestroyOnLoad(gameObject);
|
||||
isInitialized = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("AudioManager already exist! Destroying new instance.");
|
||||
Destroy(this);
|
||||
Debug.LogWarning("AudioManager already exists! Destroying new instance.");
|
||||
Destroy(gameObject); // Destroy the whole GameObject, not just the component
|
||||
}
|
||||
|
||||
if (isInitialized)
|
||||
{
|
||||
isInitialized = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void SetWwiseMusicState(WwiseMusicState MusicState)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user