Check if any bark is happening in code
Posted: Tue Oct 18, 2022 9:29 pm
Hi!
I'm trying to make a dynamic UI that hides or show if the character is speaking. This is to prevent UI overlaping .
I have the following code:
That works pretty well. I would like to use something like , but for Barks.
I'm trying to make a dynamic UI that hides or show if the character is speaking. This is to prevent UI overlaping .
I have the following code:
Code: Select all
private void ManagePopupVisibility()
{
var shouldShow = true;
if(pawnSearching == null) shouldShow = false; // if there is no pawn hiding, don't show the popup
if(DialogueManager.instance != null && DialogueManager.isConversationActive) shouldShow = false; // if there is a conversation, don't show the popup (to prevent overlaping)
if(_popup.IsShowing && _popup.IsVisible) shouldShow = false; // if the popup is already showing, don't show it again
if(shouldShow)
{
_popup.Show();
}
else
{
_popup.Hide();
}
}
Code: Select all
DialogueManager.isConversationActive