// Update is called once per frame void Update() { if (lineShowed) { if (currentHideCondition == null || currentHideCondition()) { HideSubtitleUI(); currentHideCondition = null; } } }
/// <summary> /// Push line and it is interruptable /// </summary> /// <param name="line"></param> /// <param name="hideCondition"></param> public void PushLine(string line, HideLineCondition hideCondition) { if (hideCondition == null || string.IsNullOrEmpty(line)) { Debug.LogWarning("No hidden condition added, will not shouw assigned line"); return; } if (m_text != null) { m_text.text = line.Replace("\\n", "\n"); } ShowSubtitleUI(); currentHideCondition = hideCondition; }