- Fully implemented Detective Noir presentation.

- Video loading at the start of a round should be more reliable now.
This commit is contained in:
2025-11-26 22:19:47 -05:00
parent b00f2ce346
commit 3c5d94425d
20 changed files with 1245 additions and 517 deletions
File diff suppressed because it is too large Load Diff
+16 -10
View File
@@ -37,21 +37,23 @@ public enum SFXEventType
TheLoot,
TheWarrant,
FogHorn,
JailDoorSlam,
InJail,
MapCorrect,
MapIncorrect,
CarmenInJail,
CarmenEscape,
LeverCartoon,
Boing,
Printer,
Thunder,
FogHorn,
JailDoorSlam,
DistantFoghorn,
LightSwitch,
PhoneRing,
TimerEnd,
CarmenEscape
TimerEnd
}
@@ -89,20 +91,22 @@ public class AudioManager : UdonSharpBehaviour
[SerializeField] private AudioClip _TheLoot = null;
[SerializeField] private AudioClip _TheWarrant = null;
[SerializeField] private AudioClip _FogHorn = null;
[SerializeField] private AudioClip _JailDoorSlam = null;
[SerializeField] private AudioClip _MapCorrect = null;
[SerializeField] private AudioClip _MapIncorrect = null;
[SerializeField] private AudioClip _CarmenInJail = null;
[SerializeField] private AudioClip _CarmenEscape = null;
[SerializeField] private AudioClip _LeverCartoon = null;
[SerializeField] private AudioClip _Boing = null;
[SerializeField] private AudioClip _Printer = null;
[SerializeField] private AudioClip _Thunder = null;
[SerializeField] private AudioClip _FogHorn = null;
[SerializeField] private AudioClip _JailDoorSlam = null;
[SerializeField] private AudioClip _DistantFoghorn = null;
[SerializeField] private AudioClip _LightSwitch = null;
[SerializeField] private AudioClip _PhoneRing = null;
[SerializeField] private AudioClip _TimerEnd = null;
[SerializeField] private AudioClip _CarmenEscape = null;
[Space][Header("Crook Themes")]
[SerializeField] private AudioClip _CrookTheme_Contessa = null;
@@ -278,20 +282,22 @@ public class AudioManager : UdonSharpBehaviour
case SFXEventType.TheLoot: _SFXPlayer.clip = _TheLoot; break;
case SFXEventType.TheWarrant: _SFXPlayer.clip = _TheWarrant; break;
case SFXEventType.FogHorn: _SFXPlayer.clip = _FogHorn; break;
case SFXEventType.JailDoorSlam: _SFXPlayer.clip = _JailDoorSlam; break;
case SFXEventType.MapCorrect: _SFXPlayer.clip = _MapCorrect; break;
case SFXEventType.MapIncorrect: _SFXPlayer.clip = _MapIncorrect; break;
case SFXEventType.CarmenInJail: _SFXPlayer.clip = _CarmenInJail; break;
case SFXEventType.CarmenEscape: _SFXPlayer.clip = _CarmenEscape; break;
case SFXEventType.LeverCartoon: _SFXPlayer.clip = _LeverCartoon; break;
case SFXEventType.Boing: _SFXPlayer.clip = _Boing; break;
case SFXEventType.Printer: _SFXPlayer.clip = _Printer; break;
case SFXEventType.Thunder: _SFXPlayer.clip = _Thunder; break;
case SFXEventType.FogHorn: _SFXPlayer.clip = _FogHorn; break;
case SFXEventType.JailDoorSlam: _SFXPlayer.clip = _JailDoorSlam; break;
case SFXEventType.DistantFoghorn: _SFXPlayer.clip = _DistantFoghorn; break;
case SFXEventType.LightSwitch: _SFXPlayer.clip = _LightSwitch; break;
case SFXEventType.PhoneRing: _SFXPlayer.clip = _PhoneRing; break;
case SFXEventType.TimerEnd: _SFXPlayer.clip = _TimerEnd; break;
case SFXEventType.CarmenEscape: _SFXPlayer.clip = _CarmenEscape; break;
default: _SFXPlayer.clip = null; break;
}
+245
View File
@@ -0,0 +1,245 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: DetectiveNoirEffect
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 8cfb36b9d91a52144944b7b7483eca8a,
type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: f869d57eb7111c24faac6199a920b5e1, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: 3329048536200152850
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: fieldDefinitions
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
UdonSharp.Editor]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 3
- 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:
- Name: $k
Entry: 1
Data: _Animator
- Name: $v
Entry: 7
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _Animator
- Name: <UserType>k__BackingField
Entry: 7
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 8
- 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: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 10|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: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _Activate
- Name: <UserType>k__BackingField
Entry: 7
Data: 12|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 12
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 2
- Name:
Entry: 7
Data: 14|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 15|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: da559b73fe438124eb755624f938f789
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
+26
View File
@@ -0,0 +1,26 @@
using UdonSharp;
using UnityEngine;
public class DetectiveNoirEffect : UdonSharpBehaviour
{
[SerializeField] private AudioManager _AudioManager;
[SerializeField] private Animator _Animator;
[UdonSynced, FieldChangeCallback(nameof(Activate))] private bool _Activate = false;
public bool Activate
{
set
{
_Activate = value;
_Animator.SetBool("Activate", _Activate);
if (!_Activate) _AudioManager.PlaySFX(SFXEventType.LightSwitch);
RequestSerialization();
}
get => _Activate;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f869d57eb7111c24faac6199a920b5e1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1675,13 +1675,13 @@ MonoBehaviour:
Data: 107|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule
Data: DetectiveNoirEffect, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 107
Data: 4
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1854,11 +1854,17 @@ MonoBehaviour:
Entry: 1
Data: _LightningRoundAnimator
- Name: <UserType>k__BackingField
Entry: 9
Data: 107
Entry: 7
Data: 119|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 107
Data: 119
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -1873,14 +1879,14 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 119|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
Data: 120|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
mscorlib
- Name:
Entry: 12
Data: 3
- Name:
Entry: 7
Data: 120|UnityEngine.SpaceAttribute, UnityEngine.CoreModule
Data: 121|UnityEngine.SpaceAttribute, UnityEngine.CoreModule
- Name: height
Entry: 4
Data: 8
@@ -1889,7 +1895,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 7
Data: 121|UnityEngine.HeaderAttribute, UnityEngine.CoreModule
Data: 122|UnityEngine.HeaderAttribute, UnityEngine.CoreModule
- Name: header
Entry: 1
Data: Effects
@@ -1898,7 +1904,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 7
Data: 122|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 123|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -49,7 +49,7 @@ public class GameManagerRound1 : GameManagerBase
[SerializeField] private CaseVideoSyncPlayer _VideoPlayer;
[SerializeField] private ACMECrimenetComputer _ACMECrimenetComputer;
[SerializeField] private VideoMusicClueSkateboard _VideoMusicClueSkateboard;
[SerializeField] private Animator _DetectiveNoirEffect;
[SerializeField] private DetectiveNoirEffect _DetectiveNoirEffect;
[SerializeField] private Modem _Modem;
[SerializeField] private ArrivalDisplay _ArrivalDisplay;
@@ -217,8 +217,6 @@ public class GameManagerRound1 : GameManagerBase
ShowBetweenQuestionsInterface();
_VideoPlayer.ShowScreen = ClueScreenType.Blank;
_GameHasBegun = true;
}
@@ -381,24 +379,24 @@ public class GameManagerRound1 : GameManagerBase
private void InitialiseDetectiveNoirEffect(DataDictionary Presentation)
{
_QuestionSubstage++;
switch (_QuestionSubstage)
{
case 0:
_DetectiveNoirEffect.SetBool("Activate", true);
EnableInteraction("Play Video");
_QuestionSubstage++;
Debug.LogError("[GameManagerRound1] We should have just activated the noir effect.");
break;
case 1:
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, "PlaySFX", SFXEventType.DistantFoghorn);
EnableInteraction("Black And White");
break;
case 2:
_DetectiveNoirEffect.Activate = true;
EnableInteraction("Play Video");
break;
case 3:
_VideoPlayer.PlayVideo = true;
EnableInteraction("Back To Colour");
_QuestionSubstage++;
Debug.LogError("[GameManagerRound1] We should have just started playing the video.");
break;
default:
_DetectiveNoirEffect.SetBool("Activate", false);
_DetectiveNoirEffect.Activate = false;
MultipleChoiceRevealQuestion();
Debug.LogError("[GameManagerRound1] The question is revealed.");
break;
}
}
@@ -1666,6 +1664,8 @@ public class GameManagerRound1 : GameManagerBase
private HostCardBetweenRoundsInterface ShowBetweenQuestionsInterface()
{
_VideoPlayer.ShowScreen = ClueScreenType.Blank;
HostCardBetweenRoundsInterface Interface =
(HostCardBetweenRoundsInterface)GetHostCardInterface(RoundSegmentType.BetweenSegments);