Filing cabinet now properly opens and closes for all players without issue.

This commit is contained in:
Jamie Greunbaum 2025-12-11 23:51:35 -05:00
parent c13f73903b
commit 4a43e50a8c
11 changed files with 123 additions and 62 deletions

View File

@ -99162,6 +99162,7 @@ MonoBehaviour:
- {fileID: 2100000, guid: 35c2a316ece610b4b963e047e5238337, type: 2}
- {fileID: 2100000, guid: bd33b7e8a1d3cd74b8059a1a4602033a, type: 2}
- {fileID: 2100000, guid: 8ded9a8136c72af4f901e652f138f9b6, type: 2}
- {fileID: 2100000, guid: b4ebc3728120eee449696f9b988eebcb, type: 2}
- {fileID: 2100000, guid: 483ceb65615010745bde1d5ff9fd9dd6, type: 2}
- {fileID: 2100000, guid: c10453b4aa0c864458b74f3797cb611e, type: 2}
LightMapsNear: []

View File

@ -44,7 +44,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 12
Data: 13
- Name:
Entry: 7
Data:
@ -608,19 +608,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _ClueNotesCache
Data: _CachedDrawerIsOpen
- Name: $v
Entry: 7
Data: 41|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ClueNotesCache
Data: _CachedDrawerIsOpen
- Name: <UserType>k__BackingField
Entry: 9
Data: 26
Data: 38
- Name: <SystemType>k__BackingField
Entry: 9
Data: 26
Data: 38
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@ -656,19 +656,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _ClueImagesCache
Data: _ClueNotesCache
- Name: $v
Entry: 7
Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ClueImagesCache
Data: _ClueNotesCache
- Name: <UserType>k__BackingField
Entry: 9
Data: 30
Data: 26
- Name: <SystemType>k__BackingField
Entry: 9
Data: 30
Data: 26
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@ -704,19 +704,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _ClueImageScalesCache
Data: _ClueImagesCache
- Name: $v
Entry: 7
Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ClueImageScalesCache
Data: _ClueImagesCache
- Name: <UserType>k__BackingField
Entry: 9
Data: 34
Data: 30
- Name: <SystemType>k__BackingField
Entry: 9
Data: 34
Data: 30
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@ -747,6 +747,54 @@ MonoBehaviour:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _ClueImageScalesCache
- Name: $v
Entry: 7
Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ClueImageScalesCache
- Name: <UserType>k__BackingField
Entry: 9
Data: 34
- Name: <SystemType>k__BackingField
Entry: 9
Data: 34
- 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: 48|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:

View File

@ -21,6 +21,7 @@ public class FilingCabinet : UdonSharpBehaviour
[UdonSynced] public float[] ClueImageScales = new float[DRAWER_COUNT] { 1.0f, 1.0f, 1.0f, 1.0f };
[UdonSynced] private bool[] _DrawerIsOpen = new bool[DRAWER_COUNT] { false, false, false, false };
private bool[] _CachedDrawerIsOpen = new bool[DRAWER_COUNT] { false, false, false, false };
private string[] _ClueNotesCache = new string[DRAWER_COUNT];
private int[] _ClueImagesCache = new int[DRAWER_COUNT];
@ -113,16 +114,18 @@ public class FilingCabinet : UdonSharpBehaviour
}
}
if (_DrawerIsOpen[Index])
if (_CachedDrawerIsOpen[Index] != _DrawerIsOpen[Index])
{
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All,
"PlaySFX", SFXEventType.FileCabinetOpen);
}
else
{
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All,
"PlaySFX", SFXEventType.FileCabinetClose);
if (_DrawerIsOpen[Index])
{
_AudioManager.PlaySFX(SFXEventType.FileCabinetOpen);
}
else
{
_AudioManager.PlaySFX(SFXEventType.FileCabinetClose);
}
}
_CachedDrawerIsOpen[Index] = _DrawerIsOpen[Index];
}
@ -165,20 +168,24 @@ public class FilingCabinet : UdonSharpBehaviour
{
set
{
_Activate = value;
foreach(GameObject Trigger in _DrawerHandleTriggers)
if (_Activate != value)
{
Trigger.SetActive(_Activate);
}
_Activate = value;
if (!_Activate)
{
for (int i = 0; i < DRAWER_COUNT; i++)
foreach (GameObject Trigger in _DrawerHandleTriggers)
{
_DrawerIsOpen[i] = false;
ToggleDrawer(i);
Trigger.SetActive(_Activate);
}
if (!_Activate)
{
for (int i = 0; i < DRAWER_COUNT; i++)
{
_DrawerIsOpen[i] = false;
ToggleDrawer(i);
}
}
RequestSerialization();
}
}

View File

@ -31,30 +31,6 @@ public class FilingCabinetNoteDispenser : UdonSharpBehaviour
_ClueImageDownloader = new VRCImageDownloader();
}
public bool Activate
{
set
{
_Activate = value;
if (_Note != "") _Animator.SetBool("Spring Action", _Activate);
_ClueCard.localPosition = Vector3.zero;
_ClueCard.localRotation = Quaternion.identity;
_ImageCard.transform.localPosition = Vector3.zero;
_ImageCard.transform.localRotation = Quaternion.identity;
if (_Activate && Note != "")
{
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, "PlaySFX", SFXEventType.Boing2);
}
RequestSerialization();
}
get => _Activate;
}
private void LoadClueImage()
{
@ -81,6 +57,35 @@ public class FilingCabinetNoteDispenser : UdonSharpBehaviour
}
public bool Activate
{
set
{
if (_Activate != value)
{
_Activate = value;
_ClueCard.localPosition = Vector3.zero;
_ClueCard.localRotation = Quaternion.identity;
_ImageCard.transform.localPosition = Vector3.zero;
_ImageCard.transform.localRotation = Quaternion.identity;
if (Note != "")
{
_Animator.SetBool("Spring Action", _Activate);
if (_Activate)
{
_AudioManager.PlaySFX(SFXEventType.Boing2);
}
}
RequestSerialization();
}
}
get => _Activate;
}
public string Note
{
set

View File

@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: BoneFollower
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: ccbda9bf23e2f714c9226283c77a92e5,
serializedUdonProgramAsset: {fileID: 11400000, guid: 52ecc8a73071e8e40928c3609699fcf4,
type: 2}
udonAssembly:
assemblyError:

View File

@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: InteractToggle
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 405e38d3dfb2f514daeed0e28fbb4864,
serializedUdonProgramAsset: {fileID: 11400000, guid: 873dfce61b1514e429c92e0d2fded7de,
type: 2}
udonAssembly:
assemblyError:

View File

@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: PlayerModSetter
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: f938e6c4ff027a74da405a1f9353fd2b,
serializedUdonProgramAsset: {fileID: 11400000, guid: e81558796a212ab4d88e305e2010f24b,
type: 2}
udonAssembly:
assemblyError:

View File

@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: GlobalToggleObject
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: c49c9265a3ef24642a6a4465d0a78872,
serializedUdonProgramAsset: {fileID: 11400000, guid: 2fe8ced6184000f49bca526cd2c5891c,
type: 2}
udonAssembly:
assemblyError:

View File

@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: MasterToggleObject
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 04024a76ab1924042ba521e11cb76d91,
serializedUdonProgramAsset: {fileID: 11400000, guid: a2d01d9f36ac6df49831be249e48ecc4,
type: 2}
udonAssembly:
assemblyError:

View File

@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: TrackingDataFollower
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 17f8fbbe6cc186d4f8dbb057b01a4ec2,
serializedUdonProgramAsset: {fileID: 11400000, guid: 1b89d4552983c0448a7389decec3b555,
type: 2}
udonAssembly:
assemblyError:

View File

@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: WorldAudioSettings
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 128d924a3066b7546b2d1c73e61006ab,
serializedUdonProgramAsset: {fileID: 11400000, guid: 994b559b0f158b4499f8937980ed8694,
type: 2}
udonAssembly:
assemblyError: