Forum rules - please read before posting.

Display Dialogue Timer only for Timed Dialogues

Is there currently a way to display the Dialogue Timer UI (Unity UI Based) only if the conversation is timed?
I only have a few timed conversations and as it is right now, the empty slider bar is displayed in each conversation,

Comments

  • You can hook into the OnMenuTurnOn event to set its visibility automatically:

    using UnityEngine;
    using AC;
    
    public class SetTimerVisibility : MonoBehaviour
    {
    
        private void OnEnable () { EventManager.OnMenuTurnOn += OnMenuTurnOn; }
        private void OnDisable () { EventManager.OnMenuTurnOn -= OnMenuTurnOn; }
    
        private void OnMenuTurnOn (Menu menu, bool isInstant)
        {
            if (menu.title == "Conversation" && KickStarter.playerInput.activeConversation)
            {
                menu.GetElementWithName ("Timer").IsVisible = KickStarter.playerInput.activeConversation.isTimed;
            }
        }
    
    }
    

    Add this to the UI and change the menu/element name to suit.

  • Perfect, thanks!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.