- Secret Vulpine trigger is now network synced. - Horseshoe is now network synced. Continuous for now, manual sync is planned.
38 lines
720 B
C#
38 lines
720 B
C#
|
|
using UdonSharp;
|
|
using UnityEngine;
|
|
using VRC.SDKBase;
|
|
using VRC.Udon;
|
|
|
|
public class SecretVulpineTrigger : UdonSharpBehaviour
|
|
{
|
|
public GameObject Vulpine;
|
|
|
|
[UdonSynced, FieldChangeCallback(nameof(SetFoxActive))]
|
|
private bool FoxIsActive = false;
|
|
|
|
|
|
public override void Interact()
|
|
{
|
|
if (Vulpine != null)
|
|
{
|
|
Networking.SetOwner(Networking.LocalPlayer, gameObject);
|
|
SetProgramVariable("FoxIsActive", !FoxIsActive);
|
|
|
|
RequestSerialization();
|
|
}
|
|
}
|
|
|
|
|
|
public bool SetFoxActive
|
|
{
|
|
set
|
|
{
|
|
Vulpine.SetActive(!Vulpine.activeSelf);
|
|
FoxIsActive = value;
|
|
}
|
|
|
|
get => FoxIsActive;
|
|
}
|
|
}
|