예제 #1
0
 public static void InitMusic(SceneManager.SceneType sceneType)
 {
     if (Instance == null)
     {
         return;
     }
     Instance.InitListener();
     Instance.InitAudioSource(sceneType);
 }
예제 #2
0
    private void InitAudioSource(SceneManager.SceneType sceneType)
    {
        string path = string.Empty;

        if (sceneType == SceneManager.SceneType.Login)
        {
            path = "res/audio/login.audio";
        }
        else if (sceneType == SceneManager.SceneType.Deploy)
        {
            path = "res/audio/battle.audio";
        }
        if (string.IsNullOrEmpty(path))
        {
            return;
        }
        Object res = AssetLoader.GetAsset(path);

        InitAudioClip(res);
    }