fix audio bug

master
tigerchen 6 years ago
parent c5beafd1f1
commit 713cfd17ff
  1. 2
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scenes/DarkSea.unity
  2. 2
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/StatManager.cs

@ -328,7 +328,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b44ad6717e6ec8641a8aead6800d2fdf, type: 3} m_Script: {fileID: 11500000, guid: b44ad6717e6ec8641a8aead6800d2fdf, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
fade_sec: 0.1 fade_sec: 1
loop_to_trigger: 2 loop_to_trigger: 2
use_horse_sound: 1 use_horse_sound: 1
idle_player: {fileID: 540220394} idle_player: {fileID: 540220394}

@ -106,6 +106,7 @@ public class StatManager : MonoBehaviour
else if (m_timer > trigger_time) else if (m_timer > trigger_time)
{ {
if (aud == null) if (aud == null)
{
aud = gameObject.AddComponent<AudioSource>(); aud = gameObject.AddComponent<AudioSource>();
aud.loop = false; aud.loop = false;
aud.playOnAwake = false; aud.playOnAwake = false;
@ -115,6 +116,7 @@ public class StatManager : MonoBehaviour
aud.clip = no_horse_clip; aud.clip = no_horse_clip;
aud.Play(); aud.Play();
h_player.Play(); h_player.Play();
}
//m_timer = 0f; //m_timer = 0f;
Debug.Log("horse fade in"); Debug.Log("horse fade in");

Loading…
Cancel
Save