浏览代码

Fixed bug in crossfading volume

jamesperet 2 年之前
父节点
当前提交
f2d83e15f1
共有 3 个文件被更改,包括 8 次插入4 次删除
  1. 2 2
      Readme.md
  2. 5 1
      Runtime/SoundtrackManager.cs
  3. 1 1
      package.json

+ 2 - 2
Readme.md

@@ -1,6 +1,6 @@
-# 📦 KairoEngine.Soundtrack.v0.1.1
-
+# 📦 KairoEngine.Soundtrack.v0.1.2
 
+The Soundtrack module contains the ``SoundtrackManager``, ``Playlist`` and ``Soundtrack`` scripts for playing a list of songs, crossfading and looping.
 
 ### 🛑Required packages
 

+ 5 - 1
Runtime/SoundtrackManager.cs

@@ -97,7 +97,11 @@ namespace KairoEngine.SoundtrackSystem
             instance.SwitchAudioSource();
             instance.Play(soundtrack, instance.currentAudioSourceIndex);
             if(soundtrack.fadeIn) instance.StartCoroutine(SoundtrackManager.StartFade(instance.currentAudioSourceIndex, soundtrack.fadeTime, 1f, false));
-            else instance.audioSource1.volume = 1f;
+            else 
+            {
+                if(instance.currentAudioSourceIndex == 1) instance.audioSource1.volume = 1f;
+                else if(instance.currentAudioSourceIndex == 2) instance.audioSource2.volume = 1f;
+            }
         }
 
         public static void FadeOutSoundtrack(float time = 1f)

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
     "name": "at.kairoscope.kairoengine.soundtrack",
     "displayName": "KairoEngine Soundtrack System",
-    "version": "0.1.1",
+    "version": "0.1.2",
     "unity": "2020.3",
     "description": "Kairoengine soundtrack library. ",
     "dependencies": {