This is a result of my own doing but I'm wondering if you've experienced any hanging with the Alert Panel, as in the message isn't hidden until another alert message is displayed? I have a few different scenarios where this is happening but I believe they're all similar so hopefully the provided example is enough to tell me where I'm in error.
The example I have is with the Timeline Sequencer and the Alert channel plugin with a simple script that skips to the last second of the timeline. If the player presses the skip button (if ((Input.GetButtonDown("Fire2")) || (Input.GetKey(KeyCode.B)))) I have a command to set the Alert Panel to Hide but for some reason this doesn't always work (sometimes it does and sometimes it doesn't, or it appears that way at least) and if so, the message hangs on the screen until another message is displayed.
Any ideas why this might be?
Thanks in advance
Nathan
Code: Select all
using UnityEngine;
using UnityEngine.Playables;
using PixelCrushers.DialogueSystem.TextMeshPro;
public class VSStopTimeline : MonoBehaviour
{
[SerializeField]
private PlayableDirector timeline;
[SerializeField]
private TextMeshProDialogueUI alertUI;
// Use this for initialization
public void Update()
{
if (timeline != null)
{
if (alertUI != null)
{
if (timeline.state == PlayState.Playing)
{
if ((Input.GetButtonDown("Fire2")) || (Input.GetKey(KeyCode.B)))
{
timeline.time = (timeline.duration - 1);
alertUI.HideAlert();
}
}
}
else
{
alertUI = FindObjectOfType<TextMeshProDialogueUI>();
}
}
}
}