- Keeping logs of previous round winners so player names can be referenced.

- Round 3 sync seems to work now, but resets and early grabs cause issues.
This commit is contained in:
Jamie Greunbaum 2025-07-18 03:59:55 -04:00
parent 6456720622
commit 999a0342d5
6 changed files with 200 additions and 71 deletions

View File

@ -42296,15 +42296,6 @@ MonoBehaviour:
useAssignedLayers: 0
DynamicPrefabs: []
DynamicMaterials:
- {fileID: 2100000, guid: 0c3dfdcd7a2a6ac408ec3d431f9a4932, type: 2}
- {fileID: 2100000, guid: cac39def7281c5c488b6a3465ec1951b, type: 2}
- {fileID: 2100000, guid: 9cdc0250a4c9b534fae68ae6aa90bf31, type: 2}
- {fileID: 2100000, guid: af0c1cbaaffed304ba0e3a1fbac41e7e, type: 2}
- {fileID: 2100000, guid: cc22c7f9de95cab4488b30fe8699a82a, type: 2}
- {fileID: 2100000, guid: fe872fb72ad98da4dbb868481468e848, type: 2}
- {fileID: 2100000, guid: c1b531b2f1a7dab43b46daa7546cfda7, type: 2}
- {fileID: 2100000, guid: accd304c49b7d6d43b97738e8e118342, type: 2}
- {fileID: 2100000, guid: 2c0cd617d97924748a9d5e2eeb2039b5, type: 2}
- {fileID: 2100000, guid: 95dd396b63c6ad4429ad37eedc63f20c, type: 2}
- {fileID: 2100000, guid: 74aa3dbc50df9464e8d9d11815b389a7, type: 2}
- {fileID: 2100000, guid: 79cb8dae66bc60241b5964b24ff1ac7e, type: 2}
@ -42315,17 +42306,26 @@ MonoBehaviour:
- {fileID: 2100000, guid: 82bace4c334919c4f92e87905c39fdf8, type: 2}
- {fileID: 2100000, guid: c4382cc6d54262b46913ae6fe8a3740e, type: 2}
- {fileID: 2100000, guid: 7eb7cd9bfc12d4c4198d1874ca5a1aa4, type: 2}
- {fileID: 2100000, guid: af0c1cbaaffed304ba0e3a1fbac41e7e, type: 2}
- {fileID: 2100000, guid: cc22c7f9de95cab4488b30fe8699a82a, type: 2}
- {fileID: 2100000, guid: fe872fb72ad98da4dbb868481468e848, type: 2}
- {fileID: 2100000, guid: faae26a849699fc4b804b74882a344df, 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: c3186340e03d26341969d34663dbf8f3, type: 2}
- {fileID: 2100000, guid: 49170bf20870c7c45873b3c1966d86af, type: 2}
- {fileID: 2100000, guid: bd8b723337ae5824fa61f693f76e943f, type: 2}
- {fileID: 2100000, guid: faae26a849699fc4b804b74882a344df, type: 2}
- {fileID: 2100000, guid: a793cd1d5fe89c440900d816c7b8c323, type: 2}
- {fileID: 2100000, guid: 9cdc0250a4c9b534fae68ae6aa90bf31, type: 2}
- {fileID: 2100000, guid: 80746b095abb6ce41a1c737df3649172, type: 2}
- {fileID: 2100000, guid: d1244b908a4cccd4397cc9cad45fe846, type: 2}
- {fileID: 2100000, guid: 71ede89a28bd60e4ca2918572046ba90, type: 2}
- {fileID: 2100000, guid: e45d02bbf7268504ca58513c548a58e7, type: 2}
- {fileID: 2100000, guid: d1244b908a4cccd4397cc9cad45fe846, type: 2}
- {fileID: 2100000, guid: 220d5a1f1701e674794a1083cc2f0bac, type: 2}
- {fileID: 2100000, guid: 341141e903fac3e4ca54a62259c6d01d, type: 2}
- {fileID: 2100000, guid: cac39def7281c5c488b6a3465ec1951b, type: 2}
LightMapsNear: []
LightMapsFar: []
LightMode: 0

View File

@ -212,6 +212,11 @@ public class CaseManager : UdonSharpBehaviour
RequestSerialization();
}
public string[] GetCurrentWinningPlayers()
{
return _CurrentWinningPlayers;
}
public string CrookToString(AccusedCrook Crook)
{

View File

@ -44,7 +44,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 8
Data: 9
- Name:
Entry: 7
Data:
@ -519,6 +519,60 @@ MonoBehaviour:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _Players
- Name: $v
Entry: 7
Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _Players
- Name: <UserType>k__BackingField
Entry: 9
Data: 23
- Name: <SystemType>k__BackingField
Entry: 9
Data: 23
- 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: 34|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 35|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: 13
Data:

View File

@ -3,8 +3,8 @@ using UdonSharp;
using UnityEngine;
using VRC.SDK3.Data;
using VRC.SDK3.UdonNetworkCalling;
using VRC.Udon.Common.Interfaces;
using VRC.SDKBase;
using VRC.Udon.Common.Interfaces;
public enum PanelType
@ -28,6 +28,7 @@ public class GameManagerRound2 : GameManagerBase
[UdonSynced] private int _StageIndex = 0;
[UdonSynced] private int _CurrentPlayerCounter = 0;
[UdonSynced] private string[] _Players = new string[2];
public override void InitialiseGameMode()
@ -111,8 +112,17 @@ public class GameManagerRound2 : GameManagerBase
private void BeginRound()
{
_Players = _CaseManager.GetCurrentWinningPlayers();
if (_Players == null || _Players.Length != 2)
{
_Players = new string[2];
_Players[0] = Networking.GetOwner(gameObject).displayName;
_Players[1] = _Players[0];
}
HostCardRecoverTheLootInterface RecoverTheLootInterface =
(HostCardRecoverTheLootInterface)GetHostCardInterface(RoundSegmentType.RecoverTheLoot);
RecoverTheLootInterface.SetComment(_Players[_CurrentPlayerCounter % _Players.Length] + ", you're up first.", Color.black);
for (int i = 0; i < _Landmarks.Length; i++)
{
@ -193,16 +203,20 @@ public class GameManagerRound2 : GameManagerBase
// and should also enable victory animations.
public void YoureWinner()
{
string[] Winner = new string[1];
Winner[0] = _Players[_CurrentPlayerCounter % _Players.Length];
_CaseManager.SetCurrentWinningPlayers(Winner);
HostCardRecoverTheLootInterface Interface =
(HostCardRecoverTheLootInterface)GetHostCardInterface(RoundSegmentType.RecoverTheLoot);
Interface.SetComment("Winner! Congratulations, [[PLAYER]]", Color.red);
Interface.SetComment("Winner! Congratulations, " + Winner[0], Color.red);
Interface.EnableAllPanelButtons(false);
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)_AudioManager, NetworkEventTarget.All,
"StopMusic");
EnableInteraction("Continue with the game in whatever way ends up being necessary when this is implemented");
EnableInteraction("Go To The Map");
}
@ -229,7 +243,7 @@ public class GameManagerRound2 : GameManagerBase
Interface.EnableAllPanelButtons(true);
Interface.SetComment("[[PLAYER]], your turn.", Color.black);
Interface.SetComment(_Players[_CurrentPlayerCounter % _Players.Length] + ", your turn.", Color.black);
RequestSerialization();
}

View File

@ -44,7 +44,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 15
Data: 16
- Name:
Entry: 7
Data:
@ -536,25 +536,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _CollisionCheckCounter
Data: _CheckingCollisions
- Name: $v
Entry: 7
Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CollisionCheckCounter
Data: _CheckingCollisions
- Name: <UserType>k__BackingField
Entry: 9
Data: 32
Data: 15
- Name: <SystemType>k__BackingField
Entry: 9
Data: 32
Data: 15
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
@ -566,7 +566,13 @@ MonoBehaviour:
Data: 36|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 1
- Name:
Entry: 7
Data: 37|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
@ -584,13 +590,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _NoCollisionCounter
Data: _CollisionCheckCounter
- Name: $v
Entry: 7
Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _NoCollisionCounter
Data: _CollisionCheckCounter
- Name: <UserType>k__BackingField
Entry: 9
Data: 32
@ -611,7 +617,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 39|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@ -632,25 +638,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _CollidingLocations
Data: _NoCollisionCounter
- Name: $v
Entry: 7
Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CollidingLocations
Data: _NoCollisionCounter
- Name: <UserType>k__BackingField
Entry: 7
Data: 40|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDK3.Data.DataList, VRCSDK3
- Name:
Entry: 8
Data:
Entry: 9
Data: 32
- Name: <SystemType>k__BackingField
Entry: 9
Data: 40
Data: 32
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@ -686,19 +686,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _RigidBodyComponent
Data: _CollidingLocations
- Name: $v
Entry: 7
Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _RigidBodyComponent
Data: _CollidingLocations
- Name: <UserType>k__BackingField
Entry: 7
Data: 43|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Rigidbody, UnityEngine.PhysicsModule
Data: VRC.SDK3.Data.DataList, VRCSDK3
- Name:
Entry: 8
Data:
@ -740,25 +740,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _ObjectSync
Data: _RigidBodyComponent
- Name: $v
Entry: 7
Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ObjectSync
Data: _RigidBodyComponent
- Name: <UserType>k__BackingField
Entry: 7
Data: 46|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: MMMaellon.LightSync.LightSync, com.mmmaellon.lightsync
Data: UnityEngine.Rigidbody, UnityEngine.PhysicsModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
Data: 46
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@ -794,25 +794,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _PickupComponent
Data: _ObjectSync
- Name: $v
Entry: 7
Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _PickupComponent
Data: _ObjectSync
- Name: <UserType>k__BackingField
Entry: 7
Data: 49|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDK3.Components.VRCPickup, VRCSDK3
Data: MMMaellon.LightSync.LightSync, com.mmmaellon.lightsync
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 49
Data: 4
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@ -848,19 +848,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _MarkerMesh
Data: _PickupComponent
- Name: $v
Entry: 7
Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _MarkerMesh
Data: _PickupComponent
- Name: <UserType>k__BackingField
Entry: 7
Data: 52|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.MeshRenderer, UnityEngine.CoreModule
Data: VRC.SDK3.Components.VRCPickup, VRCSDK3
- Name:
Entry: 8
Data:
@ -897,6 +897,60 @@ MonoBehaviour:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _MarkerMesh
- Name: $v
Entry: 7
Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _MarkerMesh
- Name: <UserType>k__BackingField
Entry: 7
Data: 55|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.MeshRenderer, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 55
- 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: false
- Name: _fieldAttributes
Entry: 7
Data: 56|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: 13
Data:

View File

@ -23,6 +23,7 @@ public class FloorMapMarker : UdonSharpBehaviour
[UdonSynced] private bool _LocationFindingEnabled = false;
[UdonSynced] private int _FailureCounter = 0;
[UdonSynced] private bool _CheckingCollisions = false;
private int _CollisionCheckCounter = 0;
private int _NoCollisionCounter = 0;
private DataList _CollidingLocations = new DataList();
@ -34,7 +35,7 @@ public class FloorMapMarker : UdonSharpBehaviour
private const int MAX_FAILURE_COUNT = 2;
private const int MAX_REPEAT_COLLISION_CHECKS = 3;
private const int MAX_TIME_WITH_NO_COLLISIONS = 8;
private const int MAX_CHECKS_WITH_NO_COLLISIONS = 8;
private const float TIME_BETWEEN_REPEAT_COLLISION_CHECKS = 0.15f;
@ -55,7 +56,9 @@ public class FloorMapMarker : UdonSharpBehaviour
IsGrabbed = false;
IsLit = false;
_LocationFindingEnabled = false;
_CheckingCollisions = false;
_FailureCounter = 0;
_CollisionCheckCounter = 0;
_NoCollisionCounter = 0;
_CollidingLocations.Clear();
@ -75,9 +78,7 @@ public class FloorMapMarker : UdonSharpBehaviour
if (Location != null)
{
_CollidingLocations.Add(Location);
_CollisionCheckCounter = 0;
_NoCollisionCounter = 0;
if (!IsGrabbed) CheckCollisions();
}
}
@ -87,8 +88,6 @@ public class FloorMapMarker : UdonSharpBehaviour
if (Location != null)
{
_CollidingLocations.Remove(Location);
_CollisionCheckCounter = 0;
_NoCollisionCounter = 0;
}
}
@ -139,17 +138,20 @@ public class FloorMapMarker : UdonSharpBehaviour
}
_NoCollisionCounter = 0;
CheckCollisions();
if (!_CheckingCollisions) SendCustomNetworkEvent(NetworkEventTarget.Owner, nameof(CheckCollisions));
}
RequestSerialization();
}
[NetworkCallable]
public void CheckCollisions()
{
if (!Active || !_LocationFindingEnabled || IsGrabbed) return;
_CheckingCollisions = true;
if (_CollidingLocations.Count > 0 && IsUpright())
{
_NoCollisionCounter = 0;
@ -162,8 +164,7 @@ public class FloorMapMarker : UdonSharpBehaviour
bool FoundCorrectResponse = ConfirmChoice(Location.Country, Location.City);
if (FoundCorrectResponse)
{
SendCustomNetworkEvent(NetworkEventTarget.Owner,
nameof(SendCorrectResponse), Location.transform.position);
SendCorrectResponse(Location.transform.position);
return;
}
}
@ -177,16 +178,16 @@ public class FloorMapMarker : UdonSharpBehaviour
}
else
{
SendCustomNetworkEvent(NetworkEventTarget.Owner, nameof(SendIncorrectResponse));
SendIncorrectResponse();
}
_CollisionCheckCounter++;
}
else
{
_NoCollisionCounter++;
if (_NoCollisionCounter >= MAX_TIME_WITH_NO_COLLISIONS)
if (_NoCollisionCounter >= MAX_CHECKS_WITH_NO_COLLISIONS)
{
SendCustomNetworkEvent(NetworkEventTarget.Owner, nameof(SendIncorrectResponse));
SendIncorrectResponse();
}
else
{
@ -209,33 +210,33 @@ public class FloorMapMarker : UdonSharpBehaviour
return false;
}
[NetworkCallable]
public void SendCorrectResponse(Vector3 CorrectLocation)
private void SendCorrectResponse(Vector3 CorrectLocation)
{
DisableMovementCompletely(CorrectLocation);
IsLit = true;
Active = false;
_CheckingCollisions = false;
RequestSerialization();
_GameManager.SendCustomNetworkEvent(NetworkEventTarget.Owner, "CorrectResponse");
_GameManager.PlayCorrectSound();
_GameManager.CorrectResponse();
}
[NetworkCallable]
public void SendIncorrectResponse()
private void SendIncorrectResponse()
{
DisableMovementCompletely();
_CollisionCheckCounter = 0;
_CheckingCollisions = false;
_CollidingLocations.Clear();
_FailureCounter++;
if (_FailureCounter >= MAX_FAILURE_COUNT)
{
Active = false;
_GameManager.IncorrectResponse();
_GameManager.SendCustomNetworkEvent(NetworkEventTarget.Owner, "IncorrectResponse");
}
_GameManager.PlayIncorrectSound();
@ -243,6 +244,7 @@ public class FloorMapMarker : UdonSharpBehaviour
RequestSerialization();
}
[NetworkCallable]
public void Activated(bool SetActive)
{
Active = SetActive;