From eeaf78ca2fd0963c1ce38c020022b3e60cd727c4 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Tue, 25 Aug 2015 10:46:17 +0100 Subject: [PATCH] Fixed init order issue First Say command would sometimes fail to play audio --- Assets/Fungus/UI/Scripts/WriterAudio.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Fungus/UI/Scripts/WriterAudio.cs b/Assets/Fungus/UI/Scripts/WriterAudio.cs index 8035a19c..27ae834c 100644 --- a/Assets/Fungus/UI/Scripts/WriterAudio.cs +++ b/Assets/Fungus/UI/Scripts/WriterAudio.cs @@ -37,8 +37,9 @@ namespace Fungus 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) { audioSource = GetComponent();