- Lightning round is essentially complete, with scoring fully implemented.

- Podium name tag can no longer be blocked by score card.
- Choice cards don't display text for anyone but the owner until locked in.
- Minor corrections to the ACME Crimenet logo.
This commit is contained in:
Jamie Greunbaum
2025-06-04 19:28:17 -04:00
parent a27223e2b2
commit de0a866e6d
14 changed files with 91 additions and 134 deletions
+15 -8
View File
@@ -110,14 +110,20 @@ public class ChoiceCardGroup : UdonSharpBehaviour
public void SetChoices(string[] Choices, int[] Indices)
{
_ChoiceCards[Indices[0]].ChoiceNumber = 1;
_ChoiceCardText[Indices[0]].text = Choices[0];
_ChoiceCards[Indices[1]].ChoiceNumber = 2;
_ChoiceCardText[Indices[1]].text = Choices[1];
_ChoiceCards[Indices[2]].ChoiceNumber = 3;
_ChoiceCardText[Indices[2]].text = Choices[2];
for (int i = 0; i < _ChoiceCards.Length && i < _ChoiceCardText.Length; i++)
{
_ChoiceCards[Indices[i]].ChoiceNumber = (i + 1);
_ChoiceCardText[Indices[i]].text = Choices[i];
}
}
[NetworkCallable]
public void MakeChoiceTextVisible()
{
for (int i = 0; i < _ChoiceCards.Length && i < _ChoiceCardText.Length; i++)
{
_ChoiceCardText[i].gameObject.SetActive(true);
}
}
public void LockInChoice()
@@ -147,6 +153,7 @@ public class ChoiceCardGroup : UdonSharpBehaviour
Card.ResetPosition();
_ChoiceCardText[i].text = "";
_ChoiceCardText[i].gameObject.SetActive(false);
Card.DisableInteractive = IsInVR;
+32 -10
View File
@@ -222,7 +222,10 @@ public class GameManager : UdonSharpBehaviour
for (int i = 0; i < _PlayerPodiums.Length; i++)
{
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)_PlayerPodiums[i], NetworkEventTarget.All, "VerifyResponse", _QuestionCorrectResponse);
NetworkCalling.SendCustomNetworkEvent(
(IUdonEventReceiver)_PlayerPodiums[i],
NetworkEventTarget.All,
"VerifyMultipleChoiceResponse", _QuestionCorrectResponse);
}
EnableInteraction("Next Question");
@@ -232,9 +235,18 @@ public class GameManager : UdonSharpBehaviour
private void BeginLightningRound()
{
_LightningRoundQuestionIndex = 0;
_LightningRoundInterface.HeaderUI.text = "Lightning Round | " + _CurrentQuestion["Location"].ToString();
_LightningRoundInterface.QuestionUI.text = "";
for (int i = 0; i < _LightningRoundInterface.ChoiceUI.Length && i < _LightningRoundInterface.ChoiceButtons.Length; i++)
{
_LightningRoundInterface.ChoiceUI[i].text = "";
_LightningRoundInterface.ChoiceButtonImages[i].color = Color.red;
}
EnableHostCardDisplay(QuestionType.LightningRound);
EnableBuzzers();
EnableInteraction("Next Question");
}
@@ -265,17 +277,23 @@ public class GameManager : UdonSharpBehaviour
private void LightningRoundCheckAnswer(int Answer)
{
if (_BuzzedInPlayer > 0 && _QuestionCorrectResponse == Answer)
if (_QuestionCorrectResponse == Answer)
{
for (int i = 0; i < _LightningRoundInterface.ChoiceButtons.Length; i++)
{
_LightningRoundInterface.ChoiceButtons[i].interactable = false;
}
_PlayerPodiums[_BuzzedInPlayer - 1].IncreaseScoreBy5();
int PodiumIndex = _BuzzedInPlayer - 1;
if (PodiumIndex >= 0 && PodiumIndex < _PlayerPodiums.Length)
{
NetworkCalling.SendCustomNetworkEvent(
(IUdonEventReceiver)_PlayerPodiums[PodiumIndex],
NetworkEventTarget.All,
"IncreaseScoreBy5");
}
EndBuzzInPeriod();
EnableInteraction("Next Question");
}
else
@@ -382,12 +400,16 @@ public class GameManager : UdonSharpBehaviour
public void WaitForBuzzInsWithoutLastPlayer() {
_BuzzInAllowed = true;
NetworkCalling.SendCustomNetworkEvent(
(IUdonEventReceiver)_PlayerPodiums[_BuzzedInPlayer - 1],
NetworkEventTarget.All,
"EnableBuzzInEffect", false);
_BuzzedInPlayer = -1;
RequestSerialization();
int PodiumIndex = _BuzzedInPlayer - 1;
if (PodiumIndex >= 0 && PodiumIndex < _PlayerPodiums.Length)
{
NetworkCalling.SendCustomNetworkEvent(
(IUdonEventReceiver)_PlayerPodiums[_BuzzedInPlayer - 1],
NetworkEventTarget.All,
"EnableBuzzInEffect", false);
_BuzzedInPlayer = -1;
RequestSerialization();
}
}
[NetworkCallable]
+23 -6
View File
@@ -1,10 +1,10 @@
using UdonSharp;
using UnityEngine;
using TMPro;
using VRC.SDKBase;
using VRC.SDK3.UdonNetworkCalling;
using TMPro;
using UnityEngine;
using VRC.SDK3.Components;
using VRC.Udon.Common.Interfaces;
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
public class PlayerPodium : UdonSharpBehaviour
@@ -35,22 +35,31 @@ public class PlayerPodium : UdonSharpBehaviour
public void SetPlayerName()
{
Debug.LogWarning("Player name is being set here");
if (_PlayerID != -1) { return; }
if (_PlayerID != -1)
{
return;
}
Networking.SetOwner(Networking.LocalPlayer, gameObject);
Networking.SetOwner(Networking.LocalPlayer, _ChoiceCards.gameObject);
Networking.SetOwner(Networking.LocalPlayer, _Buzzer.gameObject);
PlayerName = Networking.LocalPlayer.displayName;
_PlayerID = Networking.LocalPlayer.playerId;
RequestSerialization();
}
public int GetPlayerID() { return _PlayerID; }
[NetworkCallable]
public void DecreaseScoreBy5()
{
PlayerScore -= 5;
}
[NetworkCallable]
public void IncreaseScoreBy5()
{
PlayerScore += 5;
@@ -68,6 +77,10 @@ public class PlayerPodium : UdonSharpBehaviour
{
_ChoiceCards.gameObject.SetActive(Enable);
_ChoiceCards.ResetCards();
NetworkCalling.SendCustomNetworkEvent(
(IUdonEventReceiver)_ChoiceCards,
NetworkEventTarget.Owner,
"MakeChoiceTextVisible");
}
[NetworkCallable]
@@ -80,10 +93,14 @@ public class PlayerPodium : UdonSharpBehaviour
public void LockInChoice()
{
_ChoiceCards.LockInChoice();
NetworkCalling.SendCustomNetworkEvent(
(IUdonEventReceiver)_ChoiceCards,
NetworkEventTarget.All,
"MakeChoiceTextVisible");
}
[NetworkCallable]
public void VerifyResponse(int CorrectResponse)
public void VerifyMultipleChoiceResponse(int CorrectResponse)
{
if (_ChoiceCards.GetSelectedChoice() == CorrectResponse)
{
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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: