Browse Source

Fixed init order issue

First Say command would sometimes fail to play audio
master
chrisgregan 9 years ago
parent
commit
eeaf78ca2f
  1. 3
      Assets/Fungus/UI/Scripts/WriterAudio.cs

3
Assets/Fungus/UI/Scripts/WriterAudio.cs

@ -37,8 +37,9 @@ namespace Fungus
protected float targetVolume = 0f; protected float targetVolume = 0f;
protected virtual void Start() protected virtual void Awake()
{ {
// Need to do this in Awake rather than Start due to init order issues
if (audioSource == null) if (audioSource == null)
{ {
audioSource = GetComponent<AudioSource>(); audioSource = GetComponent<AudioSource>();

Loading…
Cancel
Save