diff --git a/Assets/Scenes/witwics.unity b/Assets/Scenes/witwics.unity index 5b2d97f..f93e826 100644 --- a/Assets/Scenes/witwics.unity +++ b/Assets/Scenes/witwics.unity @@ -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: [] diff --git a/Assets/UdonSharp/Filing Cabinet/FilingCabinet.asset b/Assets/UdonSharp/Filing Cabinet/FilingCabinet.asset index ad0e98a..cde924c 100644 --- a/Assets/UdonSharp/Filing Cabinet/FilingCabinet.asset +++ b/Assets/UdonSharp/Filing Cabinet/FilingCabinet.asset @@ -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: k__BackingField Entry: 1 - Data: _ClueNotesCache + Data: _CachedDrawerIsOpen - Name: k__BackingField Entry: 9 - Data: 26 + Data: 38 - Name: k__BackingField Entry: 9 - Data: 26 + Data: 38 - Name: 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: k__BackingField Entry: 1 - Data: _ClueImagesCache + Data: _ClueNotesCache - Name: k__BackingField Entry: 9 - Data: 30 + Data: 26 - Name: k__BackingField Entry: 9 - Data: 30 + Data: 26 - Name: 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: k__BackingField Entry: 1 - Data: _ClueImageScalesCache + Data: _ClueImagesCache - Name: k__BackingField Entry: 9 - Data: 34 + Data: 30 - Name: k__BackingField Entry: 9 - Data: 34 + Data: 30 - Name: 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: k__BackingField + Entry: 1 + Data: _ClueImageScalesCache + - Name: k__BackingField + Entry: 9 + Data: 34 + - Name: k__BackingField + Entry: 9 + Data: 34 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 6 + Data: + - Name: + Entry: 8 + Data: + - Name: 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: diff --git a/Assets/UdonSharp/Filing Cabinet/FilingCabinet.cs b/Assets/UdonSharp/Filing Cabinet/FilingCabinet.cs index 988fd55..bd3e9d4 100644 --- a/Assets/UdonSharp/Filing Cabinet/FilingCabinet.cs +++ b/Assets/UdonSharp/Filing Cabinet/FilingCabinet.cs @@ -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(); } } diff --git a/Assets/UdonSharp/Filing Cabinet/Note Dispenser/FilingCabinetNoteDispenser.cs b/Assets/UdonSharp/Filing Cabinet/Note Dispenser/FilingCabinetNoteDispenser.cs index 95df7b9..1342fb4 100644 --- a/Assets/UdonSharp/Filing Cabinet/Note Dispenser/FilingCabinetNoteDispenser.cs +++ b/Assets/UdonSharp/Filing Cabinet/Note Dispenser/FilingCabinetNoteDispenser.cs @@ -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 diff --git a/Assets/UdonSharp/UtilityScripts/BoneFollower.asset b/Assets/UdonSharp/UtilityScripts/BoneFollower.asset index b946757..036a370 100644 --- a/Assets/UdonSharp/UtilityScripts/BoneFollower.asset +++ b/Assets/UdonSharp/UtilityScripts/BoneFollower.asset @@ -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: diff --git a/Assets/UdonSharp/UtilityScripts/InteractToggle.asset b/Assets/UdonSharp/UtilityScripts/InteractToggle.asset index b35639e..13d78db 100644 --- a/Assets/UdonSharp/UtilityScripts/InteractToggle.asset +++ b/Assets/UdonSharp/UtilityScripts/InteractToggle.asset @@ -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: diff --git a/Assets/UdonSharp/UtilityScripts/PlayerModSetter.asset b/Assets/UdonSharp/UtilityScripts/PlayerModSetter.asset index 1def3de..d89a1a4 100644 --- a/Assets/UdonSharp/UtilityScripts/PlayerModSetter.asset +++ b/Assets/UdonSharp/UtilityScripts/PlayerModSetter.asset @@ -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: diff --git a/Assets/UdonSharp/UtilityScripts/Synced/GlobalToggleObject.asset b/Assets/UdonSharp/UtilityScripts/Synced/GlobalToggleObject.asset index 8101274..ea98aa4 100644 --- a/Assets/UdonSharp/UtilityScripts/Synced/GlobalToggleObject.asset +++ b/Assets/UdonSharp/UtilityScripts/Synced/GlobalToggleObject.asset @@ -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: diff --git a/Assets/UdonSharp/UtilityScripts/Synced/MasterToggleObject.asset b/Assets/UdonSharp/UtilityScripts/Synced/MasterToggleObject.asset index 901d05e..b4b3ede 100644 --- a/Assets/UdonSharp/UtilityScripts/Synced/MasterToggleObject.asset +++ b/Assets/UdonSharp/UtilityScripts/Synced/MasterToggleObject.asset @@ -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: diff --git a/Assets/UdonSharp/UtilityScripts/TrackingDataFollower.asset b/Assets/UdonSharp/UtilityScripts/TrackingDataFollower.asset index da92932..c624599 100644 --- a/Assets/UdonSharp/UtilityScripts/TrackingDataFollower.asset +++ b/Assets/UdonSharp/UtilityScripts/TrackingDataFollower.asset @@ -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: diff --git a/Assets/UdonSharp/UtilityScripts/WorldAudioSettings.asset b/Assets/UdonSharp/UtilityScripts/WorldAudioSettings.asset index ee4621f..5226f4f 100644 --- a/Assets/UdonSharp/UtilityScripts/WorldAudioSettings.asset +++ b/Assets/UdonSharp/UtilityScripts/WorldAudioSettings.asset @@ -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: