- Pickupable objects for various props changed to use VRCObjectSync. - Live indicator now uses the new lamp model from the ACME Bugnet Alert. - Light probes during round 1 illuminate contestants much better. - Fixed lightmaps for the round 1 door. - Changed import and mesh compression settings for many models.
37 lines
771 B
C#
37 lines
771 B
C#
|
|
using UdonSharp;
|
|
using UnityEngine;
|
|
|
|
|
|
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
|
|
public class LiveIndicator : UdonSharpBehaviour
|
|
{
|
|
[SerializeField] private Material _UnlitLampMaterial;
|
|
[SerializeField] private Material _LitLampMaterial;
|
|
|
|
[SerializeField] private MeshRenderer _MarkerMesh;
|
|
[SerializeField] private int _MeshLampSlot = 0;
|
|
|
|
[UdonSynced, FieldChangeCallback(nameof(Active))] private bool _Active = false;
|
|
|
|
|
|
private void ReactToActivation()
|
|
{
|
|
Material[] Materials = _MarkerMesh.materials;
|
|
Materials[_MeshLampSlot] = Active ? _LitLampMaterial : _UnlitLampMaterial;
|
|
_MarkerMesh.materials = Materials;
|
|
}
|
|
|
|
|
|
public bool Active
|
|
{
|
|
set
|
|
{
|
|
_Active = value;
|
|
ReactToActivation();
|
|
RequestSerialization();
|
|
}
|
|
get => _Active;
|
|
}
|
|
}
|