- Video load indicators are now prefabs.

- Video load indicators now properly sync and update for all clients.
- Updated lightmaps for some of the walls.
This commit is contained in:
2025-09-29 14:51:21 -04:00
parent d19fb14c91
commit f34a7b6147
31 changed files with 898 additions and 605 deletions
@@ -44,7 +44,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 3
Data: 7
- Name:
Entry: 7
Data:
@@ -86,13 +86,19 @@ MonoBehaviour:
Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
Data: 2
- Name:
Entry: 7
Data: 5|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 6|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
@@ -113,13 +119,13 @@ MonoBehaviour:
Data: _IndicateStatus
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _IndicateStatus
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: IndicationStatus, Assembly-CSharp
@@ -128,7 +134,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
Data: 9|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
@@ -149,19 +155,19 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 10|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 2
- Name:
Entry: 7
Data: 10|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
Data: 11|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 11|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
Data: 12|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
@@ -185,13 +191,13 @@ MonoBehaviour:
Data: _IndicatorMesh
- Name: $v
Entry: 7
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 13|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _IndicatorMesh
- Name: <UserType>k__BackingField
Entry: 7
Data: 13|System.RuntimeType, mscorlib
Data: 14|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.MeshRenderer, UnityEngine.CoreModule
@@ -200,7 +206,67 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 13
Data: 14
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 16|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _IdleColour
- Name: $v
Entry: 7
Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _IdleColour
- Name: <UserType>k__BackingField
Entry: 7
Data: 18|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Color, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 18
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -215,7 +281,151 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _LoadingColour
- Name: $v
Entry: 7
Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _LoadingColour
- Name: <UserType>k__BackingField
Entry: 9
Data: 18
- Name: <SystemType>k__BackingField
Entry: 9
Data: 18
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _LoadSuccessColour
- Name: $v
Entry: 7
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _LoadSuccessColour
- Name: <UserType>k__BackingField
Entry: 9
Data: 18
- Name: <SystemType>k__BackingField
Entry: 9
Data: 18
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _LoadFailureColour
- Name: $v
Entry: 7
Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _LoadFailureColour
- Name: <UserType>k__BackingField
Entry: 9
Data: 18
- Name: <SystemType>k__BackingField
Entry: 9
Data: 18
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 25|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -1,8 +1,9 @@
using UdonSharp;
using UnityEngine;
using VRC.SDK3.UdonNetworkCalling;
using VRC.SDKBase;
using VRC.Udon;
using VRC.Udon.Common.Interfaces;
public enum IndicationStatus
@@ -16,29 +17,54 @@ public enum IndicationStatus
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
public class VideoLoadIndicator : UdonSharpBehaviour
{
[UdonSynced] private string _Owner = null;
[UdonSynced, FieldChangeCallback(nameof(Owner))] private string _Owner = null;
[UdonSynced, FieldChangeCallback(nameof(IndicateStatus))] private IndicationStatus _IndicateStatus = IndicationStatus.Idle;
private MeshRenderer _IndicatorMesh;
[SerializeField] private MeshRenderer _IndicatorMesh;
private readonly Color _IdleColour = Color.black;
private readonly Color _LoadingColour = new Color(0.784313725f, 0.784313725f, 0.0f);
private readonly Color _LoadSuccessColour = new Color(0.0f, 0.784313725f, 0.0f);
private readonly Color _LoadFailureColour = new Color(0.784313725f, 0.0f, 0.0f);
void Start()
{
_IndicatorMesh = GetComponent<MeshRenderer>();
_Owner = Networking.LocalPlayer.displayName;
Owner = Networking.LocalPlayer.displayName;
}
public override void OnOwnershipTransferred(VRCPlayerApi Player)
{
_Owner = Player.displayName;
RequestSerialization();
Owner = Player.displayName;
base.OnOwnershipTransferred(Player);
}
public string GetOwner()
{
return _Owner;
return Owner;
}
private void SwapIndicatorStatusColour(IndicationStatus NewStatus)
{
switch (NewStatus)
{
case IndicationStatus.Idle: _IndicatorMesh.material.SetColor("_Color", _IdleColour); break;
case IndicationStatus.Loading: _IndicatorMesh.material.SetColor("_Color", _LoadingColour); break;
case IndicationStatus.LoadSuccess: _IndicatorMesh.material.SetColor("_Color", _LoadSuccessColour); break;
case IndicationStatus.LoadFailure: _IndicatorMesh.material.SetColor("_Color", _LoadFailureColour); break;
}
RequestSerialization();
}
private string Owner
{
set
{
_Owner = value;
SwapIndicatorStatusColour(IndicationStatus.Idle);
}
get => _Owner;
}
@@ -47,15 +73,7 @@ public class VideoLoadIndicator : UdonSharpBehaviour
set
{
_IndicateStatus = value;
switch(_IndicateStatus)
{
case IndicationStatus.Idle: _IndicatorMesh.material.SetColor("_Color", Color.black); break;
case IndicationStatus.Loading: _IndicatorMesh.material.SetColor("_Color", Color.yellow); break;
case IndicationStatus.LoadSuccess: _IndicatorMesh.material.SetColor("_Color", Color.green); break;
case IndicationStatus.LoadFailure: _IndicatorMesh.material.SetColor("_Color", Color.red); break;
}
Debug.Log("[VideoLoadIndicator] Setting load status to " + (int)_IndicateStatus);
RequestSerialization();
SwapIndicatorStatusColour(_IndicateStatus);
}
get => _IndicateStatus;
}
@@ -44,7 +44,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 1
Data: 3
- Name:
Entry: 7
Data:
@@ -105,6 +105,108 @@ MonoBehaviour:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _EnabledPosition
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _EnabledPosition
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Vector3, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _DisabledPosition
- Name: $v
Entry: 7
Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _DisabledPosition
- Name: <UserType>k__BackingField
Entry: 9
Data: 7
- Name: <SystemType>k__BackingField
Entry: 9
Data: 7
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 10|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
@@ -3,6 +3,7 @@ using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
using VRC.Udon.Serialization.OdinSerializer;
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
@@ -10,19 +11,17 @@ public class VideoLoadIndicatorGroup : UdonSharpBehaviour
{
[SerializeField] private GameObject[] _Indicators;
private readonly Vector3 _EnabledPosition = Vector3.zero;
private readonly Vector3 _DisabledPosition = new Vector3(0.0f, -1000.0f, 0.0f);
public void HostEnabled()
{
foreach (GameObject Indicator in _Indicators)
{
Indicator.SetActive(true);
}
transform.localPosition = _EnabledPosition;
}
public void HostDisabled()
{
foreach (GameObject Indicator in _Indicators)
{
Indicator.SetActive(false);
}
transform.localPosition = _DisabledPosition;
}
}