Oh, boy. Lots of changes here.

- Added SFX for opening and closing file cabinets, and an extra boing sound.
- Filing cabinet animations improved.
- Filing cabinet code made more efficient, relying less on copy-paste code.
- Cleaned up unused sound effects.
- Improved compression of used sound effects.
- Improved Wonder Rat's portrait.
- Double Trouble's portrait now matches the resolution of other portraits.
- Added missing credit information for Cody, Wyoming stock photo.
- Edited Patty Larceny's Africa jail call to match her other lines' takes.
This commit is contained in:
2025-12-03 21:02:28 -05:00
parent 769423d150
commit 433b9b9f92
75 changed files with 2030 additions and 1771 deletions
@@ -44,7 +44,73 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 11
Data: 12
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _AudioManager
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _AudioManager
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: AudioManager, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 4|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
- Name:
Entry: 8
Data:
- 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: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 6|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:
@@ -53,13 +119,13 @@ MonoBehaviour:
Data: _Animator
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _Animator
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule
@@ -68,7 +134,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 3
Data: 8
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -83,13 +149,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 5|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 10|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -113,13 +179,13 @@ MonoBehaviour:
Data: _DrawerHandleTriggers
- Name: $v
Entry: 7
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _DrawerHandleTriggers
- Name: <UserType>k__BackingField
Entry: 7
Data: 7|System.RuntimeType, mscorlib
Data: 12|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.GameObject[], UnityEngine.CoreModule
@@ -128,73 +194,7 @@ MonoBehaviour:
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: true
- Name: _fieldAttributes
Entry: 7
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 9|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: _NoteDispensers
- Name: $v
Entry: 7
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _NoteDispensers
- Name: <UserType>k__BackingField
Entry: 7
Data: 11|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: FilingCabinetNoteDispenser[], Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 12|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Component[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
Data: 12
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -236,16 +236,82 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _Activate
Data: _NoteDispensers
- Name: $v
Entry: 7
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _Activate
Data: _NoteDispensers
- Name: <UserType>k__BackingField
Entry: 7
Data: 16|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: FilingCabinetNoteDispenser[], Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 17|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Component[], UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- 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: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 19|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: _Activate
- Name: $v
Entry: 7
Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _Activate
- Name: <UserType>k__BackingField
Entry: 7
Data: 21|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
@@ -254,7 +320,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 16
Data: 21
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -269,19 +335,19 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 2
- Name:
Entry: 7
Data: 18|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
Data: 23|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 19|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
Data: 24|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
@@ -305,13 +371,13 @@ MonoBehaviour:
Data: ClueNotes
- Name: $v
Entry: 7
Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: ClueNotes
- Name: <UserType>k__BackingField
Entry: 7
Data: 21|System.RuntimeType, mscorlib
Data: 26|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.String[], mscorlib
@@ -320,7 +386,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 21
Data: 26
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -335,13 +401,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 23|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
Data: 28|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
@@ -365,13 +431,13 @@ MonoBehaviour:
Data: ClueImages
- Name: $v
Entry: 7
Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: ClueImages
- Name: <UserType>k__BackingField
Entry: 7
Data: 25|System.RuntimeType, mscorlib
Data: 30|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32[], mscorlib
@@ -380,7 +446,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 25
Data: 30
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -395,13 +461,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 27|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
Data: 32|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
@@ -425,13 +491,13 @@ MonoBehaviour:
Data: ClueImageScales
- Name: $v
Entry: 7
Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: ClueImageScales
- Name: <UserType>k__BackingField
Entry: 7
Data: 29|System.RuntimeType, mscorlib
Data: 34|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Single[], mscorlib
@@ -440,7 +506,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 29
Data: 34
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -455,13 +521,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 30|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 31|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
Data: 36|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
@@ -482,16 +548,16 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: DrawerIsOpen
Data: _DrawerIsOpen
- Name: $v
Entry: 7
Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: DrawerIsOpen
Data: _DrawerIsOpen
- Name: <UserType>k__BackingField
Entry: 7
Data: 33|System.RuntimeType, mscorlib
Data: 38|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean[], mscorlib
@@ -500,13 +566,13 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 33
Data: 38
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
@@ -515,10 +581,16 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 34|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 39|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 1
- Name:
Entry: 7
Data: 40|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
@@ -539,16 +611,16 @@ MonoBehaviour:
Data: _ClueNotesCache
- Name: $v
Entry: 7
Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 41|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ClueNotesCache
- Name: <UserType>k__BackingField
Entry: 9
Data: 21
Data: 26
- Name: <SystemType>k__BackingField
Entry: 9
Data: 21
Data: 26
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -563,7 +635,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 36|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -587,16 +659,16 @@ MonoBehaviour:
Data: _ClueImagesCache
- Name: $v
Entry: 7
Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ClueImagesCache
- Name: <UserType>k__BackingField
Entry: 9
Data: 25
Data: 30
- Name: <SystemType>k__BackingField
Entry: 9
Data: 25
Data: 30
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -611,7 +683,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -635,16 +707,16 @@ MonoBehaviour:
Data: _ClueImageScalesCache
- Name: $v
Entry: 7
Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ClueImageScalesCache
- Name: <UserType>k__BackingField
Entry: 9
Data: 29
Data: 34
- Name: <SystemType>k__BackingField
Entry: 9
Data: 29
Data: 34
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -659,7 +731,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -1,17 +1,15 @@
using System;
using UdonSharp;
using UnityEngine;
using VRC.SDK3.UdonNetworkCalling;
using VRC.SDKBase;
using VRC.Udon;
using VRC.Udon.Common;
using VRC.Udon.Serialization.OdinSerializer.Utilities;
using VRC.Udon.Common.Interfaces;
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
public class FilingCabinet : UdonSharpBehaviour
{
[SerializeField] private AudioManager _AudioManager;
[SerializeField] private Animator _Animator;
[SerializeField] private GameObject[] _DrawerHandleTriggers;
[SerializeField] private FilingCabinetNoteDispenser[] _NoteDispensers;
@@ -22,109 +20,100 @@ public class FilingCabinet : UdonSharpBehaviour
[UdonSynced] public int[] ClueImages = new int[DRAWER_COUNT] { -1, -1, -1, -1 };
[UdonSynced] public float[] ClueImageScales = new float[DRAWER_COUNT] { 1.0f, 1.0f, 1.0f, 1.0f };
private bool[] DrawerIsOpen = new bool[DRAWER_COUNT] { false, false, false, false };
[UdonSynced] private bool[] _DrawerIsOpen = new bool[DRAWER_COUNT] { false, false, false, false };
private string[] _ClueNotesCache = new string[DRAWER_COUNT];
private int[] _ClueImagesCache = new int[DRAWER_COUNT];
private float[] _ClueImageScalesCache = new float[DRAWER_COUNT];
public const int DRAWER_COUNT = 4;
private const float NOTE_DISPENSER_ACTIVATE_DELAY = 0.5f;
private const float NOTE_DISPENSER_ACTIVATE_DELAY = 0.85f;
public override void OnDeserialization(DeserializationResult Result)
{
bool NotesChanged = false;
for (int i = 0; i < DRAWER_COUNT; i++)
{
if (ClueNotes[i] != _ClueNotesCache[i] ||
ClueImages[i] != _ClueImagesCache[i] ||
ClueImageScales[i] != _ClueImageScalesCache[i])
{ // Notes and image changes
bool NotesChanged = false;
for (int i = 0; i < DRAWER_COUNT; i++)
{
NotesChanged = true;
break;
if (ClueNotes[i] != _ClueNotesCache[i] ||
ClueImages[i] != _ClueImagesCache[i] ||
ClueImageScales[i] != _ClueImageScalesCache[i])
{
NotesChanged = true;
break;
}
}
if (NotesChanged)
{
UpdateNoteData();
}
}
if (NotesChanged)
for (int i = 0; i < DRAWER_COUNT; i++)
{
UpdateNoteData();
ToggleDrawer(i);
}
base.OnDeserialization(Result);
}
[NetworkCallable]
public void OpenDrawer1()
{
DrawerIsOpen[0] = !_Animator.GetBool("Open Drawer 1");
_Animator.SetBool("Open Drawer 1", DrawerIsOpen[0]);
if (Utilities.IsValid(_NoteDispensers[0]))
{
if (DrawerIsOpen[0])
{
SendCustomEventDelayedSeconds(nameof(ActivateNoteDispenser1), NOTE_DISPENSER_ACTIVATE_DELAY);
}
else
{
ActivateNoteDispenser1();
}
}
_DrawerIsOpen[0] = !_DrawerIsOpen[0];
ToggleDrawer(0);
RequestSerialization();
}
[NetworkCallable]
public void OpenDrawer2()
{
DrawerIsOpen[1] = !_Animator.GetBool("Open Drawer 2");
_Animator.SetBool("Open Drawer 2", DrawerIsOpen[1]);
if (Utilities.IsValid(_NoteDispensers[1]))
{
if (DrawerIsOpen[1])
{
SendCustomEventDelayedSeconds(nameof(ActivateNoteDispenser2), NOTE_DISPENSER_ACTIVATE_DELAY);
}
else
{
ActivateNoteDispenser2();
}
}
_DrawerIsOpen[1] = !_DrawerIsOpen[1];
ToggleDrawer(1);
RequestSerialization();
}
[NetworkCallable]
public void OpenDrawer3()
{
DrawerIsOpen[2] = !_Animator.GetBool("Open Drawer 3");
_Animator.SetBool("Open Drawer 3", DrawerIsOpen[2]);
if (Utilities.IsValid(_NoteDispensers[2]))
{
if (DrawerIsOpen[2])
{
SendCustomEventDelayedSeconds(nameof(ActivateNoteDispenser3), NOTE_DISPENSER_ACTIVATE_DELAY);
}
else
{
ActivateNoteDispenser3();
}
}
_DrawerIsOpen[2] = !_DrawerIsOpen[2];
ToggleDrawer(2);
RequestSerialization();
}
[NetworkCallable]
public void OpenDrawer4()
{
DrawerIsOpen[3] = !_Animator.GetBool("Open Drawer 4");
_Animator.SetBool("Open Drawer 4", DrawerIsOpen[3]);
if (Utilities.IsValid(_NoteDispensers[3]))
_DrawerIsOpen[3] = !_DrawerIsOpen[3];
ToggleDrawer(3);
RequestSerialization();
}
private void ToggleDrawer(int Index)
{
_Animator.SetBool("Open Drawer " + (Index + 1), _DrawerIsOpen[Index]);
if (Utilities.IsValid(_NoteDispensers[Index]))
{
if (DrawerIsOpen[3])
if (_DrawerIsOpen[Index])
{
SendCustomEventDelayedSeconds(nameof(ActivateNoteDispenser4), NOTE_DISPENSER_ACTIVATE_DELAY);
SendCustomEventDelayedSeconds("ActivateNoteDispenser" + (Index + 1), NOTE_DISPENSER_ACTIVATE_DELAY);
}
else
{
ActivateNoteDispenser4();
SendCustomEvent("ActivateNoteDispenser" + (Index + 1));
}
}
if (_DrawerIsOpen[Index])
{
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All,
"PlaySFX", SFXEventType.FileCabinetOpen);
}
else
{
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All,
"PlaySFX", SFXEventType.FileCabinetClose);
}
}
@@ -147,19 +136,19 @@ public class FilingCabinet : UdonSharpBehaviour
public void ActivateNoteDispenser1()
{
_NoteDispensers[0].Activate = DrawerIsOpen[0];
_NoteDispensers[0].Activate = _DrawerIsOpen[0];
}
public void ActivateNoteDispenser2()
{
_NoteDispensers[1].Activate = DrawerIsOpen[1];
_NoteDispensers[1].Activate = _DrawerIsOpen[1];
}
public void ActivateNoteDispenser3()
{
_NoteDispensers[2].Activate = DrawerIsOpen[2];
_NoteDispensers[2].Activate = _DrawerIsOpen[2];
}
public void ActivateNoteDispenser4()
{
_NoteDispensers[3].Activate = DrawerIsOpen[3];
_NoteDispensers[3].Activate = _DrawerIsOpen[3];
}
@@ -173,6 +162,16 @@ public class FilingCabinet : UdonSharpBehaviour
{
Trigger.SetActive(_Activate);
}
if (!_Activate)
{
for (int i = 0; i < DRAWER_COUNT; i++)
{
_DrawerIsOpen[i] = false;
ToggleDrawer(i);
}
RequestSerialization();
}
}
get => _Activate;
}
@@ -1,11 +1,8 @@
using System;
using TMPro;
using UdonSharp;
using UnityEngine;
using VRC.SDK3.Image;
using VRC.SDKBase;
using VRC.Udon;
using VRC.Udon.Common.Interfaces;
@@ -44,6 +41,14 @@ public class FilingCabinetNoteDispenser : UdonSharpBehaviour
_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();
}