Browse Source

Add a graphic ray caster if none exists

master
chrisgregan 10 years ago
parent
commit
a79b1240ac
  1. 7
      Assets/Fungus/Narrative/Scripts/SayDialog.cs

7
Assets/Fungus/Narrative/Scripts/SayDialog.cs

@ -120,6 +120,13 @@ namespace Fungus
{ {
// Dialog always starts invisible, will be faded in when writing starts // Dialog always starts invisible, will be faded in when writing starts
GetCanvasGroup().alpha = 0f; GetCanvasGroup().alpha = 0f;
// Add a raycaster if none already exists so we can handle dialog input
GraphicRaycaster raycaster = GetComponent<GraphicRaycaster>();
if (raycaster == null)
{
gameObject.AddComponent<GraphicRaycaster>();
}
} }
public virtual void Say(string text, bool clearPrevious, bool waitForInput, bool fadeWhenDone, AudioClip audioClip, Action onComplete) public virtual void Say(string text, bool clearPrevious, bool waitForInput, bool fadeWhenDone, AudioClip audioClip, Action onComplete)

Loading…
Cancel
Save