27 lines
516 B
C#
27 lines
516 B
C#
|
|
using UdonSharp;
|
|
using UnityEngine;
|
|
|
|
|
|
public class DetectiveNoirEffect : UdonSharpBehaviour
|
|
{
|
|
[SerializeField] private AudioManager _AudioManager;
|
|
|
|
[SerializeField] private Animator _Animator;
|
|
|
|
[UdonSynced, FieldChangeCallback(nameof(Activate))] private bool _Activate = false;
|
|
|
|
|
|
public bool Activate
|
|
{
|
|
set
|
|
{
|
|
_Activate = value;
|
|
_Animator.SetBool("Activate", _Activate);
|
|
if (!_Activate) _AudioManager.PlaySFX(SFXEventType.LightSwitch);
|
|
RequestSerialization();
|
|
}
|
|
get => _Activate;
|
|
}
|
|
}
|