using PixelCrushers.DialogueSystem; using System; using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using static System.Net.Mime.MediaTypeNames; namespace Beyond { public class BeyondBarkUI : StandardBarkUI { public CanvasGroup m_statsGroup; protected override void Start() { base.Start(); HideUI.SetActive += (bool b) => { if (!b) InstantHide(); }; } public virtual void InstantHide() { if (canvasGroup) canvasGroup.gameObject.SetActive(false); numSequencesActive = 0; if (CanTriggerAnimations() && !string.IsNullOrEmpty(animationTransitions.hideTrigger)) { if (!string.IsNullOrEmpty(animationTransitions.hideTrigger)) { animator.ResetTrigger(animationTransitions.hideTrigger); } } else if (canvas != null) { canvas.enabled = false; } if (canvas != null) canvas.GetComponent().localPosition = originalCanvasLocalPosition; doneTime = 0; if (m_statsGroup) m_statsGroup.alpha = 1f; } } /* public class BeyondBarkUI : AbstractBarkUI { public Animator m_animator; public TextMeshProUGUI m_textToBark; [HideInInspector] public float doneTime = 0; /// /// The duration in seconds to show the bark text before fading it out. /// [Tooltip("The duration in seconds to show the bark text before fading it out. If zero, use the Dialogue Manager's Bark Settings.")] public float duration = 4f; /// /// Indicates whether a bark is currently playing. /// /// /// true if playing; otherwise, false. /// public override bool isPlaying { get { return (DialogueTime.time < doneTime); } } protected virtual void Awake() { m_animator = GetComponent(); } protected void OnEnable() { } public override void Bark(Subtitle subtitle) { m_textToBark.text = subtitle.formattedText.text; m_animator.SetBool("show", true); CancelInvoke("Hide"); Invoke("Hide", duration); doneTime = DialogueTime.time + duration; } public override void Hide() { m_animator.SetBool("show", false); doneTime = 0; } } */ }