diff --git a/Assets/Audio/SFX/Buzzer.wav.meta b/Assets/Audio/SFX/Buzzer.wav.meta index 23aefd5..87130e8 100644 --- a/Assets/Audio/SFX/Buzzer.wav.meta +++ b/Assets/Audio/SFX/Buzzer.wav.meta @@ -11,7 +11,7 @@ AudioImporter: compressionFormat: 1 quality: 1 conversionMode: 0 - preloadAudioData: 0 + preloadAudioData: 1 platformSettingOverrides: {} forceToMono: 0 normalize: 1 diff --git a/Assets/Audio/SFX/Ding - A#5.ogg b/Assets/Audio/SFX/Ding - A#5.ogg new file mode 100644 index 0000000..cdaed01 Binary files /dev/null and b/Assets/Audio/SFX/Ding - A#5.ogg differ diff --git a/Assets/Audio/SFX/Ding - A#5.ogg.meta b/Assets/Audio/SFX/Ding - A#5.ogg.meta new file mode 100644 index 0000000..59e028d --- /dev/null +++ b/Assets/Audio/SFX/Ding - A#5.ogg.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: c73e1e65b24947b479626ae419424e84 +AudioImporter: + externalObjects: {} + serializedVersion: 7 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 1 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/witwics.unity b/Assets/Scenes/witwics.unity index ce7e9e1..45ff047 100644 --- a/Assets/Scenes/witwics.unity +++ b/Assets/Scenes/witwics.unity @@ -1825,7 +1825,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Placeholder + m_text: No questions loaded m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} @@ -2185,11 +2185,12 @@ MonoBehaviour: - {fileID: 1441856225} - {fileID: 1939958423} _Answer: {fileID: 90622516} - BuzzerSound: {fileID: 8300000, guid: bc5aa9668b30b7e48a492e3308a2a802, type: 3} - WhereInTheWorld: {fileID: 8300000, guid: e810feeb6c2063747bbb5f735a88bee9, type: 3} - RockapellaIdent: {fileID: 8300000, guid: 3dd54f8dd36092b4d9664c76ccf9ab49, type: 3} - MusicPlayer: {fileID: 379391083} - SFXPlayer: {fileID: 379391083} + _Ding: {fileID: 8300000, guid: c73e1e65b24947b479626ae419424e84, type: 3} + _Buzzer: {fileID: 8300000, guid: bc5aa9668b30b7e48a492e3308a2a802, type: 3} + _WhereInTheWorld: {fileID: 8300000, guid: e810feeb6c2063747bbb5f735a88bee9, type: 3} + _RockapellaIdent: {fileID: 8300000, guid: 3dd54f8dd36092b4d9664c76ccf9ab49, type: 3} + _MusicPlayer: {fileID: 379391083} + _SFXPlayer: {fileID: 379391083} --- !u!114 &379391082 MonoBehaviour: m_ObjectHideFlags: 0 @@ -7108,7 +7109,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Location 3 + m_text: m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} @@ -7275,7 +7276,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Location 2 + m_text: m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} @@ -8103,7 +8104,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Location 1 + m_text: m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} diff --git a/Assets/Textures/T_AcmeCrimenet.png b/Assets/Textures/T_AcmeCrimenet.png new file mode 100644 index 0000000..b9452f1 Binary files /dev/null and b/Assets/Textures/T_AcmeCrimenet.png differ diff --git a/Assets/Textures/T_AcmeCrimenet.png.meta b/Assets/Textures/T_AcmeCrimenet.png.meta new file mode 100644 index 0000000..66ca3e6 --- /dev/null +++ b/Assets/Textures/T_AcmeCrimenet.png.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: 009859374b9fcea4a8d944195a752fee +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 3 + compressionQuality: 70 + crunchedCompression: 1 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UdonSharp/GameManager.asset b/Assets/UdonSharp/GameManager.asset index 877fdff..0199bf9 100644 --- a/Assets/UdonSharp/GameManager.asset +++ b/Assets/UdonSharp/GameManager.asset @@ -44,19 +44,19 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 20 + Data: 21 - Name: Entry: 7 Data: - Name: $k Entry: 1 - Data: BuzzInAllowed + Data: _BuzzInAllowed - Name: $v Entry: 7 Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: BuzzInAllowed + Data: _BuzzInAllowed - Name: k__BackingField Entry: 7 Data: 3|System.RuntimeType, mscorlib @@ -110,13 +110,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: PlayerBuzzInAllowed + Data: _PlayerBuzzInAllowed - Name: $v Entry: 7 Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: PlayerBuzzInAllowed + Data: _PlayerBuzzInAllowed - Name: k__BackingField Entry: 7 Data: 7|System.RuntimeType, mscorlib @@ -911,13 +911,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: BuzzerSound + Data: _Ding - Name: $v Entry: 7 Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: BuzzerSound + Data: _Ding - Name: k__BackingField Entry: 7 Data: 56|System.RuntimeType, mscorlib @@ -980,13 +980,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: WhereInTheWorld + Data: _Buzzer - Name: $v Entry: 7 Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: WhereInTheWorld + Data: _Buzzer - Name: k__BackingField Entry: 9 Data: 56 @@ -1034,13 +1034,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: RockapellaIdent + Data: _WhereInTheWorld - Name: $v Entry: 7 Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: RockapellaIdent + Data: _WhereInTheWorld - Name: k__BackingField Entry: 9 Data: 56 @@ -1088,25 +1088,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: MusicPlayer + Data: _RockapellaIdent - Name: $v Entry: 7 Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: MusicPlayer + Data: _RockapellaIdent - Name: k__BackingField - Entry: 7 - Data: 67|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.AudioSource, UnityEngine.AudioModule - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 56 - Name: k__BackingField Entry: 9 - Data: 67 + Data: 56 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1121,13 +1115,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 68|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 67|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 69|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 68|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -1148,19 +1142,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: SFXPlayer + Data: _MusicPlayer - Name: $v Entry: 7 - Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: SFXPlayer + Data: _MusicPlayer - Name: k__BackingField - Entry: 9 - Data: 67 + Entry: 7 + Data: 70|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.AudioSource, UnityEngine.AudioModule + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 67 + Data: 70 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -1197,6 +1197,60 @@ MonoBehaviour: - Name: Entry: 8 Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: _SFXPlayer + - Name: $v + Entry: 7 + Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _SFXPlayer + - Name: k__BackingField + Entry: 9 + Data: 70 + - Name: k__BackingField + Entry: 9 + Data: 70 + - 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: 74|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 75|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: 13 Data: diff --git a/Assets/UdonSharp/GameManager.cs b/Assets/UdonSharp/GameManager.cs index 2cc163f..29c5583 100644 --- a/Assets/UdonSharp/GameManager.cs +++ b/Assets/UdonSharp/GameManager.cs @@ -32,6 +32,7 @@ public enum MusicEventType public enum SFXEventType { None, + Ding, Buzzer } @@ -39,8 +40,8 @@ public enum SFXEventType [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] public class GameManager : UdonSharpBehaviour { - [UdonSynced] private bool BuzzInAllowed = false; - [UdonSynced] private bool[] PlayerBuzzInAllowed; + [UdonSynced] private bool _BuzzInAllowed = false; + [UdonSynced] private bool[] _PlayerBuzzInAllowed; [UdonSynced] private int _BuzzedInPlayer = 0; private DataList _QuestionsList = new DataList(); @@ -61,17 +62,18 @@ public class GameManager : UdonSharpBehaviour [SerializeField] private TextMeshProUGUI _Answer; [Header("Audio")] - [SerializeField] private AudioClip BuzzerSound = null; + [SerializeField] private AudioClip _Ding = null; + [SerializeField] private AudioClip _Buzzer = null; - [SerializeField] private AudioClip WhereInTheWorld = null; - [SerializeField] private AudioClip RockapellaIdent = null; + [SerializeField] private AudioClip _WhereInTheWorld = null; + [SerializeField] private AudioClip _RockapellaIdent = null; - [SerializeField] private AudioSource MusicPlayer = null; - [SerializeField] private AudioSource SFXPlayer = null; + [SerializeField] private AudioSource _MusicPlayer = null; + [SerializeField] private AudioSource _SFXPlayer = null; void Start() { - PlayerBuzzInAllowed = new bool[PlayerPodiums.Length]; + _PlayerBuzzInAllowed = new bool[PlayerPodiums.Length]; ResetBuzzers(); // Download our test question. @@ -104,7 +106,7 @@ public class GameManager : UdonSharpBehaviour _CurrentQuestion = _QuestionsList[0].DataDictionary; - Debug.Log("Found " + _QuestionsList.Count + " questions in this case file."); + _InfoHeader.text = "Found " + _QuestionsList.Count + " questions in this case file."; } else { @@ -143,10 +145,14 @@ public class GameManager : UdonSharpBehaviour public void MultipleChoiceRevealChoice1() { _InfoChoiceButtons[0].color = (_QuestionCorrectResponse == 1) ? Color.green : Color.red; + + SendCustomNetworkEvent(NetworkEventTarget.All, nameof(PlaySFXAtPitch), SFXEventType.Ding, 1.0f); } public void MultipleChoiceRevealChoice2() { _InfoChoiceButtons[1].color = (_QuestionCorrectResponse == 2) ? Color.green : Color.red; + + SendCustomNetworkEvent(NetworkEventTarget.All, nameof(PlaySFXAtPitch), SFXEventType.Ding, 1.1224566408889556272993467978076f); } public void MultipleChoiceRevealChoice3() { @@ -177,6 +183,8 @@ public class GameManager : UdonSharpBehaviour NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)PlayerPodiums[i], NetworkEventTarget.All, "SetCardChoices", ChoiceStrings, ChoiceOrder); } + SendCustomNetworkEvent(NetworkEventTarget.All, nameof(PlaySFXAtPitch), SFXEventType.Ding, 1.2599186983149743116707603530939f); + EnableInteraction("Lock Answers"); } @@ -275,7 +283,7 @@ public class GameManager : UdonSharpBehaviour public void EnableBuzzInPeriodForAllPlayers() { - BuzzInAllowed = true; + _BuzzInAllowed = true; ResetBuzzers(); } @@ -283,11 +291,11 @@ public class GameManager : UdonSharpBehaviour public void PlayerBuzzedIn(int PlayerNumber) { int PlayerIndex = PlayerNumber - 1; - if (!BuzzInAllowed || !PlayerBuzzInAllowed[PlayerIndex]) { return; } + if (!_BuzzInAllowed || !_PlayerBuzzInAllowed[PlayerIndex]) { return; } // Prevent new buzz-ins and store which player is currently buzzed in. - BuzzInAllowed = false; - PlayerBuzzInAllowed[PlayerIndex] = false; + _BuzzInAllowed = false; + _PlayerBuzzInAllowed[PlayerIndex] = false; _BuzzedInPlayer = PlayerNumber; RequestSerialization(); @@ -301,7 +309,7 @@ public class GameManager : UdonSharpBehaviour } public void WaitForBuzzInsWithoutLastPlayer() { - BuzzInAllowed = true; + _BuzzInAllowed = true; NetworkCalling.SendCustomNetworkEvent( (IUdonEventReceiver)PlayerPodiums[_BuzzedInPlayer - 1], NetworkEventTarget.All, @@ -312,13 +320,13 @@ public class GameManager : UdonSharpBehaviour public void EndBuzzInPeriod() { - BuzzInAllowed = false; + _BuzzInAllowed = false; ResetBuzzers(); } public void ResetBuzzers() { - for (int i = 0; i < PlayerPodiums.Length; i++) { PlayerBuzzInAllowed[i] = true; } + for (int i = 0; i < PlayerPodiums.Length; i++) { _PlayerBuzzInAllowed[i] = true; } _BuzzedInPlayer = -1; } @@ -362,33 +370,45 @@ public class GameManager : UdonSharpBehaviour [NetworkCallable] public void PlayMusic(MusicEventType MusicEvent) { - MusicPlayer.Stop(); + _MusicPlayer.Stop(); switch (MusicEvent) { - case MusicEventType.WhereInTheWorld: MusicPlayer.clip = WhereInTheWorld; break; - case MusicEventType.RockapellaIdent: MusicPlayer.clip = RockapellaIdent; break; - default: MusicPlayer.clip = null; break; + case MusicEventType.WhereInTheWorld: _MusicPlayer.clip = _WhereInTheWorld; break; + case MusicEventType.RockapellaIdent: _MusicPlayer.clip = _RockapellaIdent; break; + default: _MusicPlayer.clip = null; break; } - if (MusicPlayer.clip != null) - MusicPlayer.Play(); + if (_MusicPlayer.clip != null) + _MusicPlayer.Play(); } [NetworkCallable] public void PlaySFX(SFXEventType SFXEvent) { - SFXPlayer.Stop(); + PlaySFXInternal(SFXEvent); + } + [NetworkCallable] + public void PlaySFXAtPitch(SFXEventType SFXEvent, float Pitch) + { + PlaySFXInternal(SFXEvent, Pitch); + } + + private void PlaySFXInternal(SFXEventType SFXEvent, float Pitch = 1.0f) + { + _SFXPlayer.Stop(); switch (SFXEvent) { - case SFXEventType.Buzzer: SFXPlayer.clip = BuzzerSound; break; - default: SFXPlayer.clip = null; break; + case SFXEventType.Ding: _SFXPlayer.clip = _Ding; break; + case SFXEventType.Buzzer: _SFXPlayer.clip = _Buzzer; break; + default: _SFXPlayer.clip = null; break; } - if (SFXPlayer.clip != null) - SFXPlayer.Play(); + if (_SFXPlayer.clip != null) + _SFXPlayer.pitch = Pitch; + _SFXPlayer.Play(); } diff --git a/Raw Files/ACME Crimenet Logo.xcf b/Raw Files/ACME Crimenet Logo.xcf new file mode 100644 index 0000000..5b93752 Binary files /dev/null and b/Raw Files/ACME Crimenet Logo.xcf differ diff --git a/Raw Files/SFX/Ding - A#5.aup3 b/Raw Files/SFX/Ding - A#5.aup3 new file mode 100644 index 0000000..b9f318a Binary files /dev/null and b/Raw Files/SFX/Ding - A#5.aup3 differ