diff --git a/Assets/Audio/SFX/Crook Jail Call/Patty Larceny/Africa.wav b/Assets/Audio/SFX/Crook Jail Call/Patty Larceny/Africa.wav index 788d87d..e336cf7 100644 Binary files a/Assets/Audio/SFX/Crook Jail Call/Patty Larceny/Africa.wav and b/Assets/Audio/SFX/Crook Jail Call/Patty Larceny/Africa.wav differ diff --git a/Assets/Materials/ClueVideoScreen/M_ClueVideoScreen_Maps.mat b/Assets/Materials/ClueVideoScreen/M_ClueVideoScreen_Maps.mat index e58bc80..9d11511 100644 --- a/Assets/Materials/ClueVideoScreen/M_ClueVideoScreen_Maps.mat +++ b/Assets/Materials/ClueVideoScreen/M_ClueVideoScreen_Maps.mat @@ -48,7 +48,7 @@ Material: - _MainTex: m_Texture: {fileID: 0} m_Scale: {x: 0.5, y: 0.33333334} - m_Offset: {x: 0.5, y: 0.6666667} + m_Offset: {x: 0, y: 0.6666667} - _MetallicGlossMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} diff --git a/Assets/Prefabs/Case List Entry List.prefab b/Assets/Prefabs/Case List Entry List.prefab index 60858ab..7dddc98 100644 --- a/Assets/Prefabs/Case List Entry List.prefab +++ b/Assets/Prefabs/Case List Entry List.prefab @@ -803,6 +803,41 @@ PrefabInstance: propertyPath: VideoFiles.Array.data[5].url value: https://www.youtube.com/watch?v=kRGE3aMt1ew objectReference: {fileID: 0} + - target: {fileID: 6858734047833335697, guid: 3929edff864c3a84abaac327dbadaf65, + type: 3} + propertyPath: FallbackVideoFiles.Array.size + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 6858734047833335697, guid: 3929edff864c3a84abaac327dbadaf65, + type: 3} + propertyPath: FallbackVideoFiles.Array.data[0].url + value: https://filehost.battybovine.com/witwics/the-williamsburglary/Intro.mp4 + objectReference: {fileID: 0} + - target: {fileID: 6858734047833335697, guid: 3929edff864c3a84abaac327dbadaf65, + type: 3} + propertyPath: FallbackVideoFiles.Array.data[1].url + value: https://filehost.battybovine.com/witwics/the-williamsburglary/RheaPerlman.mp4 + objectReference: {fileID: 0} + - target: {fileID: 6858734047833335697, guid: 3929edff864c3a84abaac327dbadaf65, + type: 3} + propertyPath: FallbackVideoFiles.Array.data[2].url + value: https://filehost.battybovine.com/witwics/the-williamsburglary/DibloDibala.mp4 + objectReference: {fileID: 0} + - target: {fileID: 6858734047833335697, guid: 3929edff864c3a84abaac327dbadaf65, + type: 3} + propertyPath: FallbackVideoFiles.Array.data[3].url + value: https://filehost.battybovine.com/witwics/the-williamsburglary/PhoneTap.mp4 + objectReference: {fileID: 0} + - target: {fileID: 6858734047833335697, guid: 3929edff864c3a84abaac327dbadaf65, + type: 3} + propertyPath: FallbackVideoFiles.Array.data[4].url + value: https://filehost.battybovine.com/witwics/the-williamsburglary/FormerUSSR.mp4 + objectReference: {fileID: 0} + - target: {fileID: 6858734047833335697, guid: 3929edff864c3a84abaac327dbadaf65, + type: 3} + propertyPath: FallbackVideoFiles.Array.data[5].url + value: https://filehost.battybovine.com/witwics/the-williamsburglary/Junkanoo.mp4 + objectReference: {fileID: 0} - target: {fileID: 7635005722111176880, guid: 3929edff864c3a84abaac327dbadaf65, type: 3} propertyPath: m_Material diff --git a/Assets/Scenes/witwics.unity b/Assets/Scenes/witwics.unity index 7cb3982..047bf8c 100644 --- a/Assets/Scenes/witwics.unity +++ b/Assets/Scenes/witwics.unity @@ -13260,7 +13260,7 @@ MonoBehaviour: ThrowVelocityBoostMinSpeed: 1 ThrowVelocityBoostScale: 1 currentlyHeldBy: {fileID: 0} - pickupable: 1 + pickupable: 0 proximity: 1 --- !u!54 &379391075 Rigidbody: @@ -13417,12 +13417,12 @@ MonoBehaviour: localTransformFlag: 1 leftHandFlag: 0 kinematicFlag: 1 - pickupableFlag: 1 + pickupableFlag: 0 bounceFlag: 0 sleepFlag: 0 autoSmoothingTime: 0 lastKinematic: 1 - lastPickupable: 1 + lastPickupable: 0 _showInternalObjects: 0 showInternalObjects: 0 unparentInternalDataObject: 0 @@ -64963,7 +64963,7 @@ MonoBehaviour: PrefabModifications: [] SerializationNodes: [] _udonSharpBackingUdonBehaviour: {fileID: 2057791819} - _GameManager: {fileID: 515404446} + _CaseManager: {fileID: 841163054} _VideoPlayer: {fileID: 2057791821} _SyncFrequency: 0 _BlankScreenMesh: {fileID: 616351405} @@ -72775,34 +72775,34 @@ MonoBehaviour: useAssignedLayers: 0 DynamicPrefabs: [] DynamicMaterials: - - {fileID: 2100000, guid: 9cdc0250a4c9b534fae68ae6aa90bf31, type: 2} + - {fileID: 2100000, guid: 4fb0b8cdca56f5d47be970c7490cb7a1, type: 2} + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 2100000, guid: af0c1cbaaffed304ba0e3a1fbac41e7e, type: 2} - {fileID: 2100000, guid: cc22c7f9de95cab4488b30fe8699a82a, type: 2} - {fileID: 2100000, guid: fe872fb72ad98da4dbb868481468e848, type: 2} - - {fileID: 2100000, guid: 35c2a316ece610b4b963e047e5238337, type: 2} + - {fileID: 2100000, guid: 9cdc0250a4c9b534fae68ae6aa90bf31, type: 2} + - {fileID: 2100000, guid: c1b531b2f1a7dab43b46daa7546cfda7, type: 2} - {fileID: 2100000, guid: 0c3dfdcd7a2a6ac408ec3d431f9a4932, type: 2} + - {fileID: 2100000, guid: accd304c49b7d6d43b97738e8e118342, type: 2} + - {fileID: 2100000, guid: 2c0cd617d97924748a9d5e2eeb2039b5, type: 2} + - {fileID: 2100000, guid: 82f2961c9baa48a45ac897be257fd655, type: 2} - {fileID: 2100000, guid: 4c14b2f4b9a613f418bb1e6cf8cf68f4, type: 2} - {fileID: 2100000, guid: cf2685410a4f72447a34ea1791a70a1c, type: 2} - {fileID: 2100000, guid: c3186340e03d26341969d34663dbf8f3, type: 2} - - {fileID: 2100000, guid: 6dd6b8b1c8133f04dbc23ac81f5dfded, type: 2} - - {fileID: 2100000, guid: c1b531b2f1a7dab43b46daa7546cfda7, type: 2} - - {fileID: 2100000, guid: accd304c49b7d6d43b97738e8e118342, type: 2} - - {fileID: 2100000, guid: 2c0cd617d97924748a9d5e2eeb2039b5, type: 2} - - {fileID: 2100000, guid: a793cd1d5fe89c440900d816c7b8c323, type: 2} - {fileID: 2100000, guid: 348ff3cc54305654d9eeebbbb385c262, type: 2} - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: 6dd6b8b1c8133f04dbc23ac81f5dfded, type: 2} + - {fileID: 2100000, guid: e45d02bbf7268504ca58513c548a58e7, type: 2} + - {fileID: 2100000, guid: a793cd1d5fe89c440900d816c7b8c323, type: 2} + - {fileID: 2100000, guid: 332daba92d0976f4d86bdcdc1a94179e, type: 2} - {fileID: 2100000, guid: 98166ed003d332e488319f662c3b4429, type: 2} - {fileID: 2100000, guid: 672c36f6dbb36b5439cc0fdd2f74c531, type: 2} - - {fileID: 2100000, guid: 71fff76911e92ab43a71d15602da4c4b, type: 2} - - {fileID: 2100000, guid: cac39def7281c5c488b6a3465ec1951b, type: 2} - {fileID: 2100000, guid: 885429151ec5f6a4a926f6aaabd7e001, type: 2} - - {fileID: 2100000, guid: e45d02bbf7268504ca58513c548a58e7, type: 2} - - {fileID: 2100000, guid: 4fb0b8cdca56f5d47be970c7490cb7a1, type: 2} - - {fileID: 2100000, guid: 332daba92d0976f4d86bdcdc1a94179e, type: 2} - {fileID: 2100000, guid: d1244b908a4cccd4397cc9cad45fe846, type: 2} + - {fileID: 2100000, guid: 35c2a316ece610b4b963e047e5238337, type: 2} - {fileID: 2100000, guid: 80746b095abb6ce41a1c737df3649172, type: 2} - - {fileID: 2100000, guid: 82f2961c9baa48a45ac897be257fd655, type: 2} + - {fileID: 2100000, guid: cac39def7281c5c488b6a3465ec1951b, type: 2} - {fileID: 2100000, guid: bc5888e576e9cb34bab7b7af42d2b63f, type: 2} + - {fileID: 2100000, guid: 71fff76911e92ab43a71d15602da4c4b, type: 2} LightMapsNear: [] LightMapsFar: [] LightMode: 0 diff --git a/Assets/UdonSharp/CaseVideoSyncPlayer.asset b/Assets/UdonSharp/CaseVideoSyncPlayer.asset index 0fec43b..934c1a9 100644 --- a/Assets/UdonSharp/CaseVideoSyncPlayer.asset +++ b/Assets/UdonSharp/CaseVideoSyncPlayer.asset @@ -50,19 +50,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _GameManager + Data: _CaseManager - Name: $v Entry: 7 Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: _GameManager + Data: _CaseManager - Name: k__BackingField Entry: 7 Data: 3|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: GameManagerRound1, Assembly-CSharp + Data: CaseManager, Assembly-CSharp - Name: Entry: 8 Data: @@ -314,25 +314,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _VideoURL + Data: _VideoIndex - Name: $v Entry: 7 Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: _VideoURL + Data: _VideoIndex - Name: k__BackingField - Entry: 7 - Data: 23|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: VRC.SDKBase.VRCUrl, VRCSDKBase - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 8 - Name: k__BackingField Entry: 9 - Data: 23 + Data: 8 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -347,19 +341,19 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 2 - Name: Entry: 7 - Data: 25|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 24|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 26|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime + Data: 25|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: @@ -383,13 +377,13 @@ MonoBehaviour: Data: _TimeAndOffset - Name: $v Entry: 7 - Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _TimeAndOffset - Name: k__BackingField Entry: 7 - Data: 28|System.RuntimeType, mscorlib + Data: 27|System.RuntimeType, mscorlib - Name: Entry: 1 Data: UnityEngine.Vector2, UnityEngine.CoreModule @@ -398,7 +392,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 28 + Data: 27 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -413,19 +407,19 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 28|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 2 - Name: Entry: 7 - Data: 30|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 29|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: - Name: Entry: 7 - Data: 31|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime + Data: 30|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: @@ -449,7 +443,7 @@ MonoBehaviour: Data: _VideoIsPlaying - Name: $v Entry: 7 - Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _VideoIsPlaying @@ -473,13 +467,19 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 33|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 1 + Data: 2 - Name: Entry: 7 - Data: 34|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 33|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 34|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: diff --git a/Assets/UdonSharp/CaseVideoSyncPlayer.cs b/Assets/UdonSharp/CaseVideoSyncPlayer.cs index f857059..f268afd 100644 --- a/Assets/UdonSharp/CaseVideoSyncPlayer.cs +++ b/Assets/UdonSharp/CaseVideoSyncPlayer.cs @@ -1,6 +1,9 @@  +using Newtonsoft.Json.Linq; +using System; using UdonSharp; using UnityEngine; +using VRC.SDK3.Components.Video; using VRC.SDK3.Image; using VRC.SDK3.UdonNetworkCalling; using VRC.SDK3.Video.Components.Base; @@ -19,16 +22,16 @@ public enum ClueScreenType [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] public class CaseVideoSyncPlayer : UdonSharpBehaviour { - [SerializeField] private GameManagerRound1 _GameManager; + [SerializeField] private CaseManager _CaseManager; [UdonSynced, FieldChangeCallback(nameof(SubMapIndex))] private int _SubMapIndex = 0; [UdonSynced, FieldChangeCallback(nameof(ShowScreen))] private ClueScreenType _ShowScreen = ClueScreenType.Blank; [UdonSynced, FieldChangeCallback(nameof(FlashCorrectAnswer))] private bool _FlashCorrectAnswer = false; - [UdonSynced, FieldChangeCallback(nameof(VideoURL))] private VRCUrl _VideoURL; + [UdonSynced, FieldChangeCallback(nameof(VideoIndex))] private int _VideoIndex = -1; [UdonSynced, FieldChangeCallback(nameof(TimeAndOffset))] private Vector2 _TimeAndOffset; - [UdonSynced] private bool _VideoIsPlaying; + [UdonSynced, FieldChangeCallback(nameof(PlayVideo))] private bool _VideoIsPlaying; [SerializeField] private BaseVRCVideoPlayer _VideoPlayer; [SerializeField] private float _SyncFrequency = 5.0f; @@ -105,7 +108,7 @@ public class CaseVideoSyncPlayer : UdonSharpBehaviour } private void LoadMapFromIndex(int MapIndex) { - VRCUrl MapURL = _GameManager.GetMapURL(MapIndex); + VRCUrl MapURL = _CaseManager.GetMap(MapIndex); TextureInfo AdditionalTextureInfo = new TextureInfo(); AdditionalTextureInfo.WrapModeU = TextureWrapMode.Clamp; @@ -188,38 +191,78 @@ public class CaseVideoSyncPlayer : UdonSharpBehaviour } - public void PlayVideo() + private void _LoadVideo_Private() { - _VideoPlayer.LoadURL(VideoURL); + Debug.LogWarning("[CaseVideoSyncPlayer] Loading video " + VideoIndex + "..."); - if (Networking.GetOwner(gameObject) == Networking.LocalPlayer) + TryLoadURL(); + } + public void TryLoadURL() + { + if (VideoIndex < _CaseManager.GetVideoCount()) { - _VideoIsPlaying = true; + _VideoPlayer.LoadURL(_CaseManager.GetVideo(VideoIndex)); RequestSerialization(); } + else + { + Debug.LogWarning("[CaseVideoSyncPlayer] Index is out of range. Retrying..."); + SendCustomEventDelayedSeconds(nameof(TryLoadURL), 1.0f); + } } - public void StopVideo() + private void _PlayVideo_Private() { - _VideoPlayer.Stop(); + Debug.LogWarning("[CaseVideoSyncPlayer] Playing video " + VideoIndex + "."); - if (Networking.GetOwner(gameObject) == Networking.LocalPlayer) - { - _VideoIsPlaying = false; - RequestSerialization(); - } + _VideoPlayer.Play(); + } + + private void _StopVideo_Private() + { + Debug.LogWarning("[CaseVideoSyncPlayer] Stopping video " + VideoIndex + "."); + + _VideoPlayer.Stop(); } public override void OnVideoReady() { + Debug.LogWarning("[CaseVideoSyncPlayer] Video " + VideoIndex + " is ready."); + if (_VideoIsPlaying) { - _VideoPlayer.Play(); + _PlayVideo_Private(); } base.OnVideoReady(); } + public override void OnVideoError(VideoError VideoError) + { + switch(VideoError) + { + case VideoError.Unknown: + Debug.LogError("[CaseVideoSyncPlayer] Unknown playback error."); + break; + case VideoError.InvalidURL: + Debug.LogError("[CaseVideoSyncPlayer] Invalid URL."); + break; + case VideoError.AccessDenied: + Debug.LogError("[CaseVideoSyncPlayer] Access denied."); + break; + case VideoError.PlayerError: + Debug.LogError("[CaseVideoSyncPlayer] Error with video player."); + break; + case VideoError.RateLimited: + Debug.LogError("[CaseVideoSyncPlayer] Rate limited."); + break; + } + + _VideoPlayer.Stop(); + + base.OnVideoError(VideoError); + } + public override void OnVideoStart() { if (_VideoIsPlaying) @@ -237,9 +280,11 @@ public class CaseVideoSyncPlayer : UdonSharpBehaviour public override void OnVideoEnd() { - StopVideo(); + PlayVideo = false; ShowScreen = ClueScreenType.Blank; + RequestSerialization(); + base.OnVideoEnd(); } @@ -288,7 +333,7 @@ public class CaseVideoSyncPlayer : UdonSharpBehaviour _VideoScreenMesh.transform.localPosition = new Vector3(0.0f, -1000.0f, 0.0f); _MapScreenMesh.transform.localPosition = new Vector3(0.0f, -1000.0f, 0.0f); - StopVideo(); + PlayVideo = false; break; } case ClueScreenType.Video: @@ -304,7 +349,7 @@ public class CaseVideoSyncPlayer : UdonSharpBehaviour _VideoScreenMesh.transform.localPosition = new Vector3(0.0f, -1000.0f, 0.0f); _MapScreenMesh.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f); - StopVideo(); + PlayVideo = false; break; } } @@ -344,17 +389,26 @@ public class CaseVideoSyncPlayer : UdonSharpBehaviour get => _FlashCorrectAnswer; } - public VRCUrl VideoURL + public int VideoIndex { set { - if (_VideoURL != value) - { - _VideoURL = value; - PlayVideo(); - } + _VideoIndex = value; + _LoadVideo_Private(); } - get => _VideoURL; + get => _VideoIndex; + } + + public bool PlayVideo + { + set + { + _VideoIsPlaying = value; + if (_VideoIsPlaying) _PlayVideo_Private(); + else _StopVideo_Private(); + RequestSerialization(); + } + get => _VideoIsPlaying; } public Vector2 TimeAndOffset diff --git a/Assets/UdonSharp/Game Managers/CaseManager.asset b/Assets/UdonSharp/Game Managers/CaseManager.asset index 7bcca24..8ee9cc6 100644 --- a/Assets/UdonSharp/Game Managers/CaseManager.asset +++ b/Assets/UdonSharp/Game Managers/CaseManager.asset @@ -44,7 +44,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 18 + Data: 20 - Name: Entry: 7 Data: @@ -671,13 +671,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _CaseFileClueImages + Data: _CaseFileVideosFallback - Name: $v Entry: 7 Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: _CaseFileClueImages + Data: _CaseFileVideosFallback - Name: k__BackingField Entry: 9 Data: 38 @@ -725,25 +725,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _CaseTitle + Data: _CaseFileClueImages - Name: $v Entry: 7 Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: _CaseTitle + Data: _CaseFileClueImages - Name: k__BackingField - Entry: 7 - Data: 48|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.String, mscorlib - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 38 - Name: k__BackingField Entry: 9 - Data: 48 + Data: 38 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -758,13 +752,13 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 49|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 50|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 49|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: @@ -785,19 +779,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _CaseDescription + Data: _CaseTitle - Name: $v Entry: 7 - Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: _CaseDescription + Data: _CaseTitle - Name: k__BackingField - Entry: 9 - Data: 48 + Entry: 7 + Data: 51|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 48 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -839,19 +839,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _CaseIntroVideoTranscript + Data: _CaseDescription - Name: $v Entry: 7 Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: _CaseIntroVideoTranscript + Data: _CaseDescription - Name: k__BackingField Entry: 9 - Data: 48 + Data: 51 - Name: k__BackingField Entry: 9 - Data: 48 + Data: 51 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -893,19 +893,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _StolenLoot + Data: _CaseIntroVideo - Name: $v Entry: 7 Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: _StolenLoot + Data: _CaseIntroVideo - Name: k__BackingField - Entry: 9 - Data: 48 + Entry: 7 + Data: 58|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 48 + Data: 58 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -920,13 +926,121 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 59|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 60|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - 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: _CaseIntroVideoTranscript + - Name: $v + Entry: 7 + Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _CaseIntroVideoTranscript + - Name: k__BackingField + Entry: 9 + Data: 51 + - Name: k__BackingField + Entry: 9 + Data: 51 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 62|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 63|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - 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: _StolenLoot + - Name: $v + Entry: 7 + Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _StolenLoot + - Name: k__BackingField + Entry: 9 + Data: 51 + - Name: k__BackingField + Entry: 9 + Data: 51 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 65|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 66|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: @@ -950,13 +1064,13 @@ MonoBehaviour: Data: _AccusedCrook - Name: $v Entry: 7 - Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _AccusedCrook - Name: k__BackingField Entry: 7 - Data: 61|System.RuntimeType, mscorlib + Data: 68|System.RuntimeType, mscorlib - Name: Entry: 1 Data: AccusedCrook, Assembly-CSharp @@ -964,14 +1078,8 @@ MonoBehaviour: Entry: 8 Data: - Name: k__BackingField - Entry: 7 - Data: 62|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Int32, mscorlib - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 58 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -986,13 +1094,13 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 63|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 69|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 64|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 70|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: @@ -1016,13 +1124,13 @@ MonoBehaviour: Data: _CurrentWinningPlayers - Name: $v Entry: 7 - Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 71|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _CurrentWinningPlayers - Name: k__BackingField Entry: 7 - Data: 66|System.RuntimeType, mscorlib + Data: 72|System.RuntimeType, mscorlib - Name: Entry: 1 Data: System.String[], mscorlib @@ -1031,7 +1139,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 66 + Data: 72 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1046,13 +1154,13 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 67|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 73|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 68|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 74|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: @@ -1076,13 +1184,13 @@ MonoBehaviour: Data: _CaseFileDictionary - Name: $v Entry: 7 - Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 75|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _CaseFileDictionary - Name: k__BackingField Entry: 7 - Data: 70|System.RuntimeType, mscorlib + Data: 76|System.RuntimeType, mscorlib - Name: Entry: 1 Data: VRC.SDK3.Data.DataDictionary, VRCSDK3 @@ -1091,7 +1199,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 70 + Data: 76 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1106,7 +1214,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 71|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 77|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 diff --git a/Assets/UdonSharp/Game Managers/CaseManager.cs b/Assets/UdonSharp/Game Managers/CaseManager.cs index 08407ea..0704c4a 100644 --- a/Assets/UdonSharp/Game Managers/CaseManager.cs +++ b/Assets/UdonSharp/Game Managers/CaseManager.cs @@ -43,10 +43,12 @@ public class CaseManager : UdonSharpBehaviour [UdonSynced] private VRCUrl _CaseFileLootImage; [UdonSynced] private VRCUrl[] _CaseFileMaps; [UdonSynced] private VRCUrl[] _CaseFileVideos; + [UdonSynced] private VRCUrl[] _CaseFileVideosFallback; [UdonSynced] private VRCUrl[] _CaseFileClueImages; [UdonSynced] private string _CaseTitle = ""; [UdonSynced] private string _CaseDescription = ""; + [UdonSynced] private int _CaseIntroVideo = -1; [UdonSynced] private string _CaseIntroVideoTranscript = ""; [UdonSynced] private string _StolenLoot = ""; [UdonSynced] private AccusedCrook _AccusedCrook = AccusedCrook.INDEX_MAX; @@ -79,6 +81,7 @@ public class CaseManager : UdonSharpBehaviour _CaseFileLootImage = CaseFile.LootImage; _CaseFileMaps = CaseFile.MapFiles; _CaseFileVideos = CaseFile.VideoFiles; + _CaseFileVideosFallback = CaseFile.FallbackVideoFiles; _CaseFileClueImages = CaseFile.ClueImages; VRCStringDownloader.LoadUrl(_CaseFileCluesURL, (IUdonEventReceiver)this); @@ -102,6 +105,11 @@ public class CaseManager : UdonSharpBehaviour _StolenLoot = _CaseFileDictionary["Stolen Loot"].String; _AccusedCrook = (AccusedCrook)(int)_CaseFileDictionary["Accused Crook"].Number; + if (_CaseFileDictionary.ContainsKey("Intro Video")) + { + _CaseIntroVideo = (int)_CaseFileDictionary["Intro Video"].Number; + } + if (_CaseFileDictionary.ContainsKey("Intro Video Transcript")) { _CaseIntroVideoTranscript = _CaseFileDictionary["Intro Video Transcript"].String; @@ -234,13 +242,13 @@ public class CaseManager : UdonSharpBehaviour return _CaseFileLootImage; } - public VRCUrl GetIntroVideo() + public int GetIntroVideo() { - return _CaseFileVideos[0]; + return _CaseIntroVideo; } - public VRCUrl GetVideo(int VideoIndex) + public VRCUrl GetVideo(int VideoIndex, bool Fallback = false) { - return _CaseFileVideos[VideoIndex]; + return (Fallback && _CaseFileVideosFallback.Length >= VideoIndex) ? _CaseFileVideosFallback[VideoIndex] : _CaseFileVideos[VideoIndex]; } public int GetVideoCount() { diff --git a/Assets/UdonSharp/Game Managers/CaseManagerListEntry.asset b/Assets/UdonSharp/Game Managers/CaseManagerListEntry.asset index 4d6fdf9..8a5378e 100644 --- a/Assets/UdonSharp/Game Managers/CaseManagerListEntry.asset +++ b/Assets/UdonSharp/Game Managers/CaseManagerListEntry.asset @@ -44,7 +44,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 11 + Data: 12 - Name: Entry: 7 Data: @@ -455,13 +455,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: ClueImages + Data: FallbackVideoFiles - Name: $v Entry: 7 Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: ClueImages + Data: FallbackVideoFiles - Name: k__BackingField Entry: 9 Data: 23 @@ -503,16 +503,64 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _CaseTitleText + Data: ClueImages - Name: $v Entry: 7 Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: ClueImages + - Name: k__BackingField + Entry: 9 + Data: 23 + - Name: k__BackingField + Entry: 9 + Data: 23 + - 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: true + - Name: _fieldAttributes + Entry: 7 + Data: 30|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: _CaseTitleText + - Name: $v + Entry: 7 + Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _CaseTitleText - Name: k__BackingField Entry: 7 - Data: 30|System.RuntimeType, mscorlib + Data: 32|System.RuntimeType, mscorlib - Name: Entry: 1 Data: TMPro.TextMeshProUGUI, Unity.TextMeshPro @@ -521,7 +569,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 30 + Data: 32 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -536,13 +584,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 33|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 2 - Name: Entry: 7 - Data: 32|UnityEngine.SpaceAttribute, UnityEngine.CoreModule + Data: 34|UnityEngine.SpaceAttribute, UnityEngine.CoreModule - Name: height Entry: 4 Data: 8 @@ -551,7 +599,7 @@ MonoBehaviour: Data: - Name: Entry: 7 - Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 35|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -575,16 +623,16 @@ MonoBehaviour: Data: _CrookNameText - Name: $v Entry: 7 - Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _CrookNameText - Name: k__BackingField Entry: 9 - Data: 30 + Data: 32 - Name: k__BackingField Entry: 9 - Data: 30 + Data: 32 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -599,13 +647,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 36|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 38|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -629,16 +677,16 @@ MonoBehaviour: Data: _StolenLootText - Name: $v Entry: 7 - Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _StolenLootText - Name: k__BackingField Entry: 9 - Data: 30 + Data: 32 - Name: k__BackingField Entry: 9 - Data: 30 + Data: 32 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -653,13 +701,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 39|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 41|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: diff --git a/Assets/UdonSharp/Game Managers/CaseManagerListEntry.cs b/Assets/UdonSharp/Game Managers/CaseManagerListEntry.cs index 26f7d09..912ba43 100644 --- a/Assets/UdonSharp/Game Managers/CaseManagerListEntry.cs +++ b/Assets/UdonSharp/Game Managers/CaseManagerListEntry.cs @@ -20,6 +20,7 @@ public class CaseManagerListEntry : UdonSharpBehaviour public VRCUrl LootImage; public VRCUrl[] MapFiles; public VRCUrl[] VideoFiles; + public VRCUrl[] FallbackVideoFiles; public VRCUrl[] ClueImages; [Space] diff --git a/Assets/UdonSharp/Game Managers/GameManagerBase.cs b/Assets/UdonSharp/Game Managers/GameManagerBase.cs index 3377703..801974e 100644 --- a/Assets/UdonSharp/Game Managers/GameManagerBase.cs +++ b/Assets/UdonSharp/Game Managers/GameManagerBase.cs @@ -2,6 +2,7 @@ using UdonSharp; using UnityEngine; using VRC.SDK3.Data; +using VRC.SDKBase; using VRC.Udon.Common.Interfaces; @@ -79,6 +80,8 @@ public class GameManagerBase : UdonSharpBehaviour public virtual void InitialiseGameMode() { } + public virtual void SetOwnershipOfObjects(VRCPlayerApi NewOwner) { } + public virtual void LoadQuestionData(DataToken Data) { } diff --git a/Assets/UdonSharp/Game Managers/GameManagerRound1.cs b/Assets/UdonSharp/Game Managers/GameManagerRound1.cs index c172c74..46015e8 100644 --- a/Assets/UdonSharp/Game Managers/GameManagerRound1.cs +++ b/Assets/UdonSharp/Game Managers/GameManagerRound1.cs @@ -64,10 +64,7 @@ public class GameManagerRound1 : GameManagerBase _PlayerBuzzInAllowed = new bool[_PlayerPodiums.Length]; VRCPlayerApi Owner = Networking.GetOwner(gameObject); - Networking.SetOwner(Owner, _VideoPlayer.gameObject); - Networking.SetOwner(Owner, _Modem.gameObject); - Networking.SetOwner(Owner, _ArrivalDisplay.gameObject); - Networking.SetOwner(Owner, _VideoMusicClueSkateboard.gameObject); + SetOwnershipOfObjects(Owner); _Modem.Activate(false); _ArrivalDisplay.Activate(false); @@ -81,6 +78,16 @@ public class GameManagerRound1 : GameManagerBase base.InitialiseGameMode(); } + public override void SetOwnershipOfObjects(VRCPlayerApi NewOwner) + { + Networking.SetOwner(NewOwner, _VideoPlayer.gameObject); + Networking.SetOwner(NewOwner, _Modem.gameObject); + Networking.SetOwner(NewOwner, _ArrivalDisplay.gameObject); + Networking.SetOwner(NewOwner, _VideoMusicClueSkateboard.gameObject); + + base.SetOwnershipOfObjects(NewOwner); + } + public void PlaySecondPartOfThemeMusic() { EnableInteraction("Start Game"); @@ -115,8 +122,23 @@ public class GameManagerRound1 : GameManagerBase Interface.HeaderUI.text = _CaseManager.GetCaseTitle() + " has been loaded."; Interface.CommentUI.text = _CaseManager.GetCaseDescription(); + TryIntroVideoLoad(); + _GameHasBegun = false; } + public void TryIntroVideoLoad() + { + int IntroVideoIndex = _CaseManager.GetIntroVideo(); + if (IntroVideoIndex >= 0) + { + _VideoPlayer.VideoIndex = IntroVideoIndex; + } + else + { + Debug.LogWarning("[GameManagerRound1] Intro video index is currently invalid. Retrying..."); + SendCustomEventDelayedSeconds(nameof(TryIntroVideoLoad), 1.0f); + } + } private void PlayIntroVideo() @@ -128,12 +150,13 @@ public class GameManagerRound1 : GameManagerBase Interface.HeaderUI.text = "Playing intro video..."; Interface.CommentUI.text = _CaseManager.GetIntroVideoTranscript(); - _VideoPlayer.VideoURL = _CaseManager.GetIntroVideo(); for (int i = 0; i < _PlayerPodiums.Length; i++) { _PlayerPodiums[i].SendCustomNetworkEvent(NetworkEventTarget.Owner, "ShowAuxiliaryVideoScreen", true); } + _VideoPlayer.PlayVideo = true; + EnableInteraction("Assign Points"); } @@ -230,7 +253,7 @@ public class GameManagerRound1 : GameManagerBase { Interface.CommentUI.text = ""; } - _VideoPlayer.VideoURL = _CaseManager.GetVideo((int)Videos[_QuestionSubstage].Number); + _VideoPlayer.PlayVideo = true; _QuestionSubstage++; if (_QuestionSubstage < Videos.Count) @@ -290,7 +313,7 @@ public class GameManagerRound1 : GameManagerBase } DataList Videos = Presentation["Videos"].DataList; - _VideoPlayer.VideoURL = _CaseManager.GetVideo((int)Videos[0].Number); + _VideoPlayer.PlayVideo = true; } _QuestionSubstage++; @@ -1613,6 +1636,8 @@ public class GameManagerRound1 : GameManagerBase Interface.CommentUI.text = ""; + bool VideosAvailable = false; + string PresentationMediumString = ""; if (_CurrentQuestion.ContainsKey("Presentation")) { @@ -1640,15 +1665,31 @@ public class GameManagerRound1 : GameManagerBase { Interface.CommentUI.text = Presentation["Clue Description"].String; } + + if (Presentation.ContainsKey("Videos")) + { + DataList Videos = Presentation["Videos"].DataList; + _VideoPlayer.VideoIndex = (int)Videos[_QuestionSubstage].Number; + + VideosAvailable = true; + } } else { PresentationMediumString = RoundSegmentTypeToString(_CurrentQuestionType); - EnableInteraction("Begin " + PresentationMediumString); if (_CurrentQuestion.ContainsKey("Clue Description")) { Interface.CommentUI.text = _CurrentQuestion["Clue Description"].String; } + + if (VideosAvailable) + { + EnableInteraction("Play Videos"); + } + else + { + EnableInteraction("Begin " + PresentationMediumString); + } } Interface.HeaderUI.text = "Upcoming Question: " + PresentationMediumString; diff --git a/Assets/UdonSharp/Host Card Interfaces/HostCardManager.asset b/Assets/UdonSharp/Host Card Interfaces/HostCardManager.asset index a1db618..bb3541d 100644 --- a/Assets/UdonSharp/Host Card Interfaces/HostCardManager.asset +++ b/Assets/UdonSharp/Host Card Interfaces/HostCardManager.asset @@ -44,7 +44,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 14 + Data: 15 - Name: Entry: 7 Data: @@ -221,10 +221,19 @@ MonoBehaviour: Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 1 + Data: 2 - Name: Entry: 7 - Data: 15|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 15|UnityEngine.SpaceAttribute, UnityEngine.CoreModule + - Name: height + Entry: 4 + Data: 8 + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 16|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -248,13 +257,13 @@ MonoBehaviour: Data: _LightningRoundInterface - Name: $v Entry: 7 - Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _LightningRoundInterface - Name: k__BackingField Entry: 7 - Data: 17|System.RuntimeType, mscorlib + Data: 18|System.RuntimeType, mscorlib - Name: Entry: 1 Data: HostCardLightningRoundInterface, Assembly-CSharp @@ -278,13 +287,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 19|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 20|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -308,13 +317,13 @@ MonoBehaviour: Data: _TheChaseInterface - Name: $v Entry: 7 - Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _TheChaseInterface - Name: k__BackingField Entry: 7 - Data: 21|System.RuntimeType, mscorlib + Data: 22|System.RuntimeType, mscorlib - Name: Entry: 1 Data: HostCardTheChaseInterface, Assembly-CSharp @@ -338,13 +347,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 23|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 24|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -368,13 +377,13 @@ MonoBehaviour: Data: _TiebreakerInterface - Name: $v Entry: 7 - Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _TiebreakerInterface - Name: k__BackingField Entry: 7 - Data: 25|System.RuntimeType, mscorlib + Data: 26|System.RuntimeType, mscorlib - Name: Entry: 1 Data: HostCardTiebreakerInterface, Assembly-CSharp @@ -398,13 +407,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 26|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: 27|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 28|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -428,13 +437,13 @@ MonoBehaviour: Data: _RecoverTheLootExplainerInterface - Name: $v Entry: 7 - Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _RecoverTheLootExplainerInterface - Name: k__BackingField Entry: 7 - Data: 29|System.RuntimeType, mscorlib + Data: 30|System.RuntimeType, mscorlib - Name: Entry: 1 Data: HostCardRecoverTheLootExplainerInterface, Assembly-CSharp @@ -458,13 +467,22 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 30|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 + Data: 2 - Name: Entry: 7 - Data: 31|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 32|UnityEngine.SpaceAttribute, UnityEngine.CoreModule + - Name: height + Entry: 4 + Data: 8 + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 33|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -488,13 +506,13 @@ MonoBehaviour: Data: _RecoverTheLootInterface - Name: $v Entry: 7 - Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _RecoverTheLootInterface - Name: k__BackingField Entry: 7 - Data: 33|System.RuntimeType, mscorlib + Data: 35|System.RuntimeType, mscorlib - Name: Entry: 1 Data: HostCardRecoverTheLootInterface, Assembly-CSharp @@ -518,13 +536,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 34|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 36|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 35|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 37|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -548,13 +566,13 @@ MonoBehaviour: Data: _CaptureCarmenExplainerInterface - Name: $v Entry: 7 - Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _CaptureCarmenExplainerInterface - Name: k__BackingField Entry: 7 - Data: 37|System.RuntimeType, mscorlib + Data: 39|System.RuntimeType, mscorlib - Name: Entry: 1 Data: HostCardCaptureCarmenExplainerInterface, Assembly-CSharp @@ -578,13 +596,22 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 40|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 1 + Data: 2 - Name: Entry: 7 - Data: 39|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 41|UnityEngine.SpaceAttribute, UnityEngine.CoreModule + - Name: height + Entry: 4 + Data: 8 + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 42|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -608,13 +635,13 @@ MonoBehaviour: Data: _CaptureCarmenInterface - Name: $v Entry: 7 - Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _CaptureCarmenInterface - Name: k__BackingField Entry: 7 - Data: 41|System.RuntimeType, mscorlib + Data: 44|System.RuntimeType, mscorlib - Name: Entry: 1 Data: HostCardCaptureCarmenInterface, Assembly-CSharp @@ -638,13 +665,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 45|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 43|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 46|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -668,13 +695,13 @@ MonoBehaviour: Data: _AdminPanelInterface - Name: $v Entry: 7 - Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _AdminPanelInterface - Name: k__BackingField Entry: 7 - Data: 45|System.RuntimeType, mscorlib + Data: 48|System.RuntimeType, mscorlib - Name: Entry: 1 Data: HostPanelInterface, Assembly-CSharp @@ -698,13 +725,22 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 49|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 - Data: 1 + Data: 2 - Name: Entry: 7 - Data: 47|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 50|UnityEngine.SpaceAttribute, UnityEngine.CoreModule + - Name: height + Entry: 4 + Data: 8 + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 51|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -728,13 +764,13 @@ MonoBehaviour: Data: _InteractionText - Name: $v Entry: 7 - Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _InteractionText - Name: k__BackingField Entry: 7 - Data: 49|System.RuntimeType, mscorlib + Data: 53|System.RuntimeType, mscorlib - Name: Entry: 1 Data: TMPro.TextMeshProUGUI, Unity.TextMeshPro @@ -743,7 +779,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 49 + Data: 53 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -758,13 +794,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 54|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 2 - Name: Entry: 7 - Data: 51|UnityEngine.SpaceAttribute, UnityEngine.CoreModule + Data: 55|UnityEngine.SpaceAttribute, UnityEngine.CoreModule - Name: height Entry: 4 Data: 8 @@ -773,7 +809,7 @@ MonoBehaviour: Data: - Name: Entry: 7 - Data: 52|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 56|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -792,18 +828,72 @@ MonoBehaviour: - Name: Entry: 7 Data: + - Name: $k + Entry: 1 + Data: _PickupComponent + - Name: $v + Entry: 7 + Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _PickupComponent + - Name: k__BackingField + Entry: 7 + Data: 58|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: VRC.SDK3.Components.VRCPickup, VRCSDK3 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 58 + - 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: 59|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: _IsBeingHeld - Name: $v Entry: 7 - Data: 53|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _IsBeingHeld - Name: k__BackingField Entry: 7 - Data: 54|System.RuntimeType, mscorlib + Data: 61|System.RuntimeType, mscorlib - Name: Entry: 1 Data: System.Boolean, mscorlib @@ -812,7 +902,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 54 + Data: 61 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -827,7 +917,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 62|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -851,13 +941,13 @@ MonoBehaviour: Data: _StoredJumpImpulse - Name: $v Entry: 7 - Data: 56|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _StoredJumpImpulse - Name: k__BackingField Entry: 7 - Data: 57|System.RuntimeType, mscorlib + Data: 64|System.RuntimeType, mscorlib - Name: Entry: 1 Data: System.Single, mscorlib @@ -866,7 +956,7 @@ MonoBehaviour: Data: - Name: k__BackingField Entry: 9 - Data: 57 + Data: 64 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -881,7 +971,7 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 65|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 diff --git a/Assets/UdonSharp/Host Card Interfaces/HostCardManager.cs b/Assets/UdonSharp/Host Card Interfaces/HostCardManager.cs index d3f1481..89c8e83 100644 --- a/Assets/UdonSharp/Host Card Interfaces/HostCardManager.cs +++ b/Assets/UdonSharp/Host Card Interfaces/HostCardManager.cs @@ -14,68 +14,67 @@ public class HostCardManager : UdonSharpBehaviour [Header("UI")] [SerializeField] private HostCardBetweenRoundsInterface _BetweenRoundsInterface; + + [Space] + [SerializeField] private HostCardMultipleChoiceInterface _MultipleChoiceInterface; [SerializeField] private HostCardLightningRoundInterface _LightningRoundInterface; [SerializeField] private HostCardTheChaseInterface _TheChaseInterface; [SerializeField] private HostCardTiebreakerInterface _TiebreakerInterface; + [Space] + [SerializeField] private HostCardRecoverTheLootExplainerInterface _RecoverTheLootExplainerInterface; [SerializeField] private HostCardRecoverTheLootInterface _RecoverTheLootInterface; + [Space] + [SerializeField] private HostCardCaptureCarmenExplainerInterface _CaptureCarmenExplainerInterface; [SerializeField] private HostCardCaptureCarmenInterface _CaptureCarmenInterface; + [Space] + [SerializeField] private HostPanelInterface _AdminPanelInterface; [Space] [SerializeField] private TextMeshProUGUI _InteractionText; + private VRCPickup _PickupComponent; private bool _IsBeingHeld = false; private float _StoredJumpImpulse = 0.0f; + + void Start() + { + _PickupComponent = GetComponent(); + + ResetPickupable(); + } + + public override void OnPickup() { - if (gameObject != null) - { - Networking.SetOwner(Networking.LocalPlayer, gameObject); - _StoredJumpImpulse = Networking.LocalPlayer.GetJumpImpulse(); - Networking.LocalPlayer.SetJumpImpulse(0.0f); - _IsBeingHeld = true; + _StoredJumpImpulse = Networking.LocalPlayer.GetJumpImpulse(); + Networking.LocalPlayer.SetJumpImpulse(0.0f); + _IsBeingHeld = true; - _InteractionText.gameObject.SetActive(true); - } + _InteractionText.gameObject.SetActive(true); base.OnPickup(); } public override void OnDrop() { - if (gameObject != null) - { - Networking.SetOwner(Networking.InstanceOwner, gameObject); - Networking.LocalPlayer.SetJumpImpulse(_StoredJumpImpulse); - _StoredJumpImpulse = 0.0f; - _IsBeingHeld = false; + Networking.LocalPlayer.SetJumpImpulse(_StoredJumpImpulse); + _StoredJumpImpulse = 0.0f; + _IsBeingHeld = false; - _InteractionText.gameObject.SetActive(false); - } + _InteractionText.gameObject.SetActive(false); base.OnDrop(); } - public override bool OnOwnershipRequest(VRCPlayerApi RequestingPlayer, VRCPlayerApi RequestedOwner) - { - Debug.LogError(RequestingPlayer.displayName + " is requesting that " + RequestedOwner.displayName + " become the new owner of the host card. No fucking way."); - - return false; - } - - public override void OnOwnershipTransferred(VRCPlayerApi Player) - { - Debug.LogError("New owner is " + Player); - } - public override void InputJump(bool Value, UdonInputEventArgs Args) { if (Value && _IsBeingHeld) @@ -94,6 +93,12 @@ public class HostCardManager : UdonSharpBehaviour } + public void ResetPickupable() + { + _PickupComponent.pickupable = (Networking.GetOwner(gameObject) == Networking.LocalPlayer); + } + + public void SetNextInteractionText(string NextInteractionText) { if (NextInteractionText != "") diff --git a/Raw Files/SFX/Crook Calls/Patty Larceny.aup3 b/Raw Files/SFX/Crook Calls/Patty Larceny.aup3 index 819b54c..df8b3cb 100644 Binary files a/Raw Files/SFX/Crook Calls/Patty Larceny.aup3 and b/Raw Files/SFX/Crook Calls/Patty Larceny.aup3 differ