isAnyoneBarking
Posted: Tue May 23, 2023 7:48 pm
Hi,
I want to DoSomething() only if someone is barking.
is there a bool for this?
Thanks!
I want to DoSomething() only if someone is barking.
is there a bool for this?
Thanks!
Support and discussion forum for Pixel Crushers products
https://www.pixelcrushers.com:443/phpbb/
https://www.pixelcrushers.com:443/phpbb/viewtopic.php?t=7057
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--; }
}