isAnyoneBarking

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
danosono
Posts: 16
Joined: Sun Jun 21, 2020 7:17 pm

isAnyoneBarking

Post by danosono »

Hi,

I want to DoSomething() only if someone is barking.

is there a bool for this?

Thanks!
Jesus is the answer to every problem.
https://www.gotquestions.org/know-Jesus.html
https://store.steampowered.com/app/2151420/Word/ Longest typing game on Steam OO
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: isAnyoneBarking

Post by Tony Li »

There's no such property, but you could add a small script to the Dialogue Manager that has OnBarkStart and OnBarkEnd methods, something like:

Code: Select all

public class BarkCounter : MonoBehaviour
{
    private int numBarksActive = 0;
    
    public bool isAnyoneBarking => numBarksActive > 0;
    
    void OnBarkStart(Transform actor) { numBarksActive++; }
    void OnBarkEnd(Transform actor) { numBarksActive--; }
}
danosono
Posts: 16
Joined: Sun Jun 21, 2020 7:17 pm

Re: isAnyoneBarking

Post by danosono »

Thank you sir
Jesus is the answer to every problem.
https://www.gotquestions.org/know-Jesus.html
https://store.steampowered.com/app/2151420/Word/ Longest typing game on Steam OO
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: isAnyoneBarking

Post by Tony Li »

Glad to help!
Post Reply