From 83bea35e171c2d4e5d12519850e7d88dd3cb73e6 Mon Sep 17 00:00:00 2001 From: Jamie Greunbaum Date: Sun, 27 Jul 2025 20:24:44 -0400 Subject: [PATCH] - The Chase and the final round now load their respective maps correctly. - "Correct" and "Incorrect" buttons in Round 3 work again. --- .../M_ClueVideoScreen_Maps.mat | 4 +-- Assets/Materials/M_LocationBoard_Crook.mat | 2 +- Assets/UdonSharp/CaseVideoSyncPlayer.cs | 14 +++-------- .../Game Managers/GameManagerRound1.cs | 25 +++++++++++-------- .../Game Managers/GameManagerRound3.cs | 19 +++++++++++--- .../UtilityScripts/BoneFollower.asset | 2 +- .../UtilityScripts/InteractToggle.asset | 2 +- .../UtilityScripts/PlayerModSetter.asset | 2 +- .../Synced/GlobalToggleObject.asset | 2 +- .../Synced/MasterToggleObject.asset | 2 +- .../UtilityScripts/TrackingDataFollower.asset | 2 +- .../UtilityScripts/WorldAudioSettings.asset | 2 +- 12 files changed, 42 insertions(+), 36 deletions(-) diff --git a/Assets/Materials/ClueVideoScreen/M_ClueVideoScreen_Maps.mat b/Assets/Materials/ClueVideoScreen/M_ClueVideoScreen_Maps.mat index 7a2a985..106a0cc 100644 --- a/Assets/Materials/ClueVideoScreen/M_ClueVideoScreen_Maps.mat +++ b/Assets/Materials/ClueVideoScreen/M_ClueVideoScreen_Maps.mat @@ -42,13 +42,13 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _EmissionMap: - m_Texture: {fileID: 0} + m_Texture: {fileID: 2800000, guid: 44aab33f67dfa2949a8bd0a7e20d40e7, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: m_Texture: {fileID: 0} m_Scale: {x: 0.5, y: 0.33333334} - m_Offset: {x: 0, y: 0.6666667} + m_Offset: {x: 0.5, y: 0.33333334} - _MetallicGlossMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} diff --git a/Assets/Materials/M_LocationBoard_Crook.mat b/Assets/Materials/M_LocationBoard_Crook.mat index ee79737..4967b24 100644 --- a/Assets/Materials/M_LocationBoard_Crook.mat +++ b/Assets/Materials/M_LocationBoard_Crook.mat @@ -46,7 +46,7 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: 2800000, guid: d99fce257e19ba94e9b1d9aea6dbe87f, type: 3} + m_Texture: {fileID: 2800000, guid: a9b59914da5ed7046b6ec6712d0782d9, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: diff --git a/Assets/UdonSharp/CaseVideoSyncPlayer.cs b/Assets/UdonSharp/CaseVideoSyncPlayer.cs index 81744fe..ed1c559 100644 --- a/Assets/UdonSharp/CaseVideoSyncPlayer.cs +++ b/Assets/UdonSharp/CaseVideoSyncPlayer.cs @@ -15,16 +15,6 @@ public enum ClueScreenType Map } -//public enum SubMap -//{ -// NoLabels, // 0 -// OneLabel, // 1 -// TwoLabels, // 2 -// ThreeLabels, // 3 -// CorrectLit, // 4 -// OnlyCorrect // 5 -//} - [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] public class CaseVideoSyncPlayer : UdonSharpBehaviour @@ -97,7 +87,7 @@ public class CaseVideoSyncPlayer : UdonSharpBehaviour TextureInfo AdditionalTextureInfo = new TextureInfo(); AdditionalTextureInfo.WrapModeU = TextureWrapMode.Clamp; AdditionalTextureInfo.WrapModeV = TextureWrapMode.Clamp; - AdditionalTextureInfo.GenerateMipMaps = false; + AdditionalTextureInfo.GenerateMipMaps = true; _MapDownloader.DownloadImage( MapURL, null, _UdonEventReceiverThis, AdditionalTextureInfo); } @@ -125,6 +115,8 @@ public class CaseVideoSyncPlayer : UdonSharpBehaviour } public override void OnImageLoadError(IVRCImageDownload Result) { + _MapDownloadsInProgress = false; + base.OnImageLoadError(Result); } diff --git a/Assets/UdonSharp/Game Managers/GameManagerRound1.cs b/Assets/UdonSharp/Game Managers/GameManagerRound1.cs index be2823f..ca67144 100644 --- a/Assets/UdonSharp/Game Managers/GameManagerRound1.cs +++ b/Assets/UdonSharp/Game Managers/GameManagerRound1.cs @@ -6,6 +6,7 @@ using VRC.SDK3.UdonNetworkCalling; using VRC.Udon.Common.Interfaces; using VRC.SDKBase; using VRC.SDK3.StringLoading; +using VRC.SDKBase.Midi; public enum PresentationMedium @@ -114,6 +115,11 @@ public class GameManagerRound1 : GameManagerBase _CurrentQuestionType = (RoundSegmentType)(int)_CurrentQuestion["Type"].Number; _QuestionStage = 0; + LoadMapsIntoQueue(); + } + + private void LoadMapsIntoQueue() + { if (_CurrentQuestion.ContainsKey("Maps") && _CurrentQuestion["Maps"].TokenType == TokenType.DataList) { DataList Maps = _CurrentQuestion["Maps"].DataList; @@ -541,6 +547,8 @@ public class GameManagerRound1 : GameManagerBase Interface.ChoiceButtons[i].interactable = true; } + _VideoPlayer.SubMapIndex = (Clue - 1) * 2; + EnableBuzzInPeriodForAllPlayers(); } @@ -573,6 +581,9 @@ public class GameManagerRound1 : GameManagerBase } public void TheChaseEndClue() { + NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)_AudioManager, NetworkEventTarget.All, + "PlaySFXAtPitch", SFXEventType.Ding, AudioManager.D6); + HostCardTheChaseInterface Interface = (HostCardTheChaseInterface)GetHostCardInterface(RoundSegmentType.TheChase); @@ -584,6 +595,8 @@ public class GameManagerRound1 : GameManagerBase EndBuzzInPeriod(); + _VideoPlayer.SubMapIndex++; + EnableInteraction("Next Question"); } @@ -595,16 +608,7 @@ public class GameManagerRound1 : GameManagerBase Interface.HeaderUI.text = "Introduce the round here."; - // Preload the maps for this section. - if (_CurrentQuestion.ContainsKey("Maps") && _CurrentQuestion["Maps"].TokenType == TokenType.DataList) - { - DataList Maps = _CurrentQuestion["Maps"].DataList; - for (int i = 0; i < Maps.Count; i++) - { - NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)_VideoPlayer, NetworkEventTarget.All, - "LoadMap", (int)Maps[i].Number); - } - } + LoadMapsIntoQueue(); EnableInteraction("Show Map Preview"); } @@ -926,7 +930,6 @@ public class GameManagerRound1 : GameManagerBase private void PrepareNextQuestion() { InitialiseQuestion(); - ShowBetweenQuestionsInterface(); EnableInteraction("Show Next Question"); diff --git a/Assets/UdonSharp/Game Managers/GameManagerRound3.cs b/Assets/UdonSharp/Game Managers/GameManagerRound3.cs index b53a9ff..7280566 100644 --- a/Assets/UdonSharp/Game Managers/GameManagerRound3.cs +++ b/Assets/UdonSharp/Game Managers/GameManagerRound3.cs @@ -177,8 +177,7 @@ public class GameManagerRound3 : GameManagerBase [NetworkCallable] public void CorrectResponse() { - _AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, - "PlaySFX", SFXEventType.MapCorrect); + PlayCorrectSound(); SuccessCounter++; if (SuccessCounter >= MAX_SUCCESS_COUNT) @@ -196,8 +195,7 @@ public class GameManagerRound3 : GameManagerBase [NetworkCallable] public void IncorrectResponse() { - _AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, - "PlaySFX", SFXEventType.MapIncorrect); + PlayIncorrectSound(); FailureCounter++; if (FailureCounter >= MAX_FAILURE_COUNT) @@ -343,6 +341,19 @@ public class GameManagerRound3 : GameManagerBase } + public void PlayCorrectSound() + { + _AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, + "PlaySFX", SFXEventType.MapCorrect); + } + + public void PlayIncorrectSound() + { + _AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, + "PlaySFX", SFXEventType.MapIncorrect); + } + + private void GameStatusUpdate(GameStatus NewStatus) { if ((int)_GameStatus <= (int)GameStatus.Begin) 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: