Adding player tracking as we work our way to making round 3 markers better.

This commit is contained in:
Jamie Greunbaum 2025-07-18 02:42:36 -04:00
parent e3ea75c29c
commit 6456720622
8 changed files with 232 additions and 181 deletions

View File

@ -42296,35 +42296,35 @@ MonoBehaviour:
useAssignedLayers: 0
DynamicPrefabs: []
DynamicMaterials:
- {fileID: 2100000, guid: 9cdc0250a4c9b534fae68ae6aa90bf31, type: 2}
- {fileID: 2100000, guid: faae26a849699fc4b804b74882a344df, type: 2}
- {fileID: 2100000, guid: bd8b723337ae5824fa61f693f76e943f, type: 2}
- {fileID: 2100000, guid: 7eb7cd9bfc12d4c4198d1874ca5a1aa4, type: 2}
- {fileID: 2100000, guid: 79cb8dae66bc60241b5964b24ff1ac7e, type: 2}
- {fileID: 2100000, guid: c4382cc6d54262b46913ae6fe8a3740e, type: 2}
- {fileID: 2100000, guid: 82bace4c334919c4f92e87905c39fdf8, type: 2}
- {fileID: 2100000, guid: d811246c848733b4c8310b4dec5a5fdf, type: 2}
- {fileID: 2100000, guid: f025bfafc9ecec74aa3aab468ef837d7, type: 2}
- {fileID: 2100000, guid: 50e427994e5b0224f966b200c577b78b, type: 2}
- {fileID: 2100000, guid: 5a56ded101f363e46861c8fe1c4f360e, type: 2}
- {fileID: 2100000, guid: 95dd396b63c6ad4429ad37eedc63f20c, type: 2}
- {fileID: 2100000, guid: 74aa3dbc50df9464e8d9d11815b389a7, type: 2}
- {fileID: 2100000, guid: 220d5a1f1701e674794a1083cc2f0bac, type: 2}
- {fileID: 2100000, guid: 49170bf20870c7c45873b3c1966d86af, type: 2}
- {fileID: 2100000, guid: d1244b908a4cccd4397cc9cad45fe846, type: 2}
- {fileID: 2100000, guid: cac39def7281c5c488b6a3465ec1951b, type: 2}
- {fileID: 2100000, guid: 80746b095abb6ce41a1c737df3649172, type: 2}
- {fileID: 2100000, guid: e45d02bbf7268504ca58513c548a58e7, type: 2}
- {fileID: 2100000, guid: accd304c49b7d6d43b97738e8e118342, type: 2}
- {fileID: 2100000, guid: 2c0cd617d97924748a9d5e2eeb2039b5, type: 2}
- {fileID: 2100000, guid: 0c3dfdcd7a2a6ac408ec3d431f9a4932, type: 2}
- {fileID: 2100000, guid: c1b531b2f1a7dab43b46daa7546cfda7, type: 2}
- {fileID: 2100000, guid: c3186340e03d26341969d34663dbf8f3, 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}
- {fileID: 2100000, guid: 5a56ded101f363e46861c8fe1c4f360e, type: 2}
- {fileID: 2100000, guid: 50e427994e5b0224f966b200c577b78b, type: 2}
- {fileID: 2100000, guid: f025bfafc9ecec74aa3aab468ef837d7, type: 2}
- {fileID: 2100000, guid: d811246c848733b4c8310b4dec5a5fdf, type: 2}
- {fileID: 2100000, guid: 82bace4c334919c4f92e87905c39fdf8, type: 2}
- {fileID: 2100000, guid: c4382cc6d54262b46913ae6fe8a3740e, type: 2}
- {fileID: 2100000, guid: 7eb7cd9bfc12d4c4198d1874ca5a1aa4, 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: 80746b095abb6ce41a1c737df3649172, 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}
LightMapsNear: []
LightMapsFar: []

View File

@ -44,7 +44,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 15
Data: 16
- Name:
Entry: 7
Data:
@ -872,16 +872,76 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _CaseFileDictionary
Data: _CurrentWinningPlayers
- Name: $v
Entry: 7
Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CaseFileDictionary
Data: _CurrentWinningPlayers
- Name: <UserType>k__BackingField
Entry: 7
Data: 56|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.String[], mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 56
- 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: 57|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 58|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: _CaseFileDictionary
- Name: $v
Entry: 7
Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CaseFileDictionary
- Name: <UserType>k__BackingField
Entry: 7
Data: 60|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDK3.Data.DataDictionary, VRCSDK3
@ -890,7 +950,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 56
Data: 60
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@ -905,7 +965,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 57|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 61|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0

View File

@ -48,6 +48,8 @@ public class CaseManager : UdonSharpBehaviour
[UdonSynced] private string _StolenLoot = "";
[UdonSynced] private AccusedCrook _AccusedCrook = AccusedCrook.INDEX_MAX;
[UdonSynced] private string[] _CurrentWinningPlayers = new string[3];
private DataDictionary _CaseFileDictionary;
@ -111,7 +113,7 @@ public class CaseManager : UdonSharpBehaviour
ErrorString = "Ensure the 'Round 3' dictionary entry is a dictionary with a key called 'Continent' and an integer value.";
}
ContinueToRound2();
ContinueToRound3();
}
else
{
@ -204,6 +206,13 @@ public class CaseManager : UdonSharpBehaviour
}
public void SetCurrentWinningPlayers(string[] NewWinners)
{
_CurrentWinningPlayers = NewWinners;
RequestSerialization();
}
public string CrookToString(AccusedCrook Crook)
{
switch (Crook)

View File

@ -852,25 +852,31 @@ public class GameManagerRound1 : GameManagerBase
}
else
{
string[] WinningPlayers = new string[2];
if (SortedPlayerScores[0] == SortedPlayerScores[1])
{
// Randomly choose which player gets the first turn in the next round.
Random.InitState(Networking.GetServerTimeInMilliseconds());
VRCPlayerApi[] Randomiser = new VRCPlayerApi[2];
Randomiser[0] = Number1;
Randomiser[1] = Number2;
int RandomIndex = Random.Range(0, 2);
Randomiser[RandomIndex].SetPlayerTag("Round1State", "FirstPlace");
WinningPlayers[0] = Randomiser[RandomIndex].displayName;
WinningPlayers[1] = Randomiser[(RandomIndex + 1) % 2].displayName;
Interface.HeaderUI.text = Number1.displayName + " and " + Number2.displayName + " are tied for first place; both will move on to the next round.";
}
else
{
// Tag first place player as first place.
Number1.SetPlayerTag("Round1State", "FirstPlace");
WinningPlayers[0] = Number1.displayName;
WinningPlayers[1] = Number2.displayName;
Interface.HeaderUI.text = Number1.displayName + " and " + Number2.displayName + " will move on to the next round.";
}
_CaseManager.SetCurrentWinningPlayers(WinningPlayers);
}
return TiebreakerNeeded;

View File

@ -44,7 +44,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 13
Data: 12
- Name:
Entry: 7
Data:
@ -759,60 +759,6 @@ MonoBehaviour:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _FailureCounter
- Name: $v
Entry: 7
Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _FailureCounter
- Name: <UserType>k__BackingField
Entry: 9
Data: 29
- Name: <SystemType>k__BackingField
Entry: 9
Data: 29
- 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: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 51|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

@ -48,8 +48,6 @@ public class GameManagerRound3 : GameManagerBase
private const int TIMER_LENGTH = 45;
[UdonSynced] private int _SuccessCounter = 0;
[UdonSynced] private int _FailureCounter = 0;
private const int MAX_FAILURE_COUNT = 2;
private const int MAX_SUCCESS_COUNT = 8;
@ -57,7 +55,6 @@ public class GameManagerRound3 : GameManagerBase
{
_StageIndex = 0;
_SuccessCounter = 0;
_FailureCounter = 0;
_Timer = TIMER_LENGTH;
for (int i = 0; i < _Markers.Length; i++)
@ -121,10 +118,7 @@ public class GameManagerRound3 : GameManagerBase
public void BeginRound()
{
NetworkCalling.SendCustomNetworkEvent(
(IUdonEventReceiver)GetCurrentMarker(),
NetworkEventTarget.Owner,
"Activated", true);
GetCurrentMarker().SendCustomNetworkEvent(NetworkEventTarget.Owner, "Activated", true);
UpdateInterface();
@ -133,7 +127,7 @@ public class GameManagerRound3 : GameManagerBase
private void StartTimer()
{
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)_AudioManager, NetworkEventTarget.All,
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All,
"PlayMusicLoop", MusicEventType.CarmenChaseMusic);
_GameStatus = GameStatus.Begin;
@ -148,8 +142,7 @@ public class GameManagerRound3 : GameManagerBase
_Timer--;
if (_Timer < 0)
{
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)this, NetworkEventTarget.Owner,
nameof(GameHasBeenLost), false);
SendCustomNetworkEvent(NetworkEventTarget.Owner, nameof(GameHasBeenLost), false);
return;
}
@ -160,19 +153,10 @@ public class GameManagerRound3 : GameManagerBase
public void CorrectResponse()
{
PlayCorrectSound();
NetworkCalling.SendCustomNetworkEvent(
(IUdonEventReceiver)GetCurrentMarker(),
NetworkEventTarget.Owner,
"Activated", false);
_FailureCounter = 0;
_SuccessCounter++;
if (_SuccessCounter >= MAX_SUCCESS_COUNT)
{
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)this, NetworkEventTarget.Owner,
nameof(GameHasBeenWon));
SendCustomNetworkEvent(NetworkEventTarget.Owner, nameof(GameHasBeenWon));
}
else
{
@ -184,19 +168,7 @@ public class GameManagerRound3 : GameManagerBase
public void IncorrectResponse()
{
_FailureCounter++;
if (_FailureCounter >= MAX_FAILURE_COUNT)
{
_FailureCounter = 0;
NetworkCalling.SendCustomNetworkEvent(
(IUdonEventReceiver)GetCurrentMarker(),
NetworkEventTarget.Owner,
"Activated", false);
SetUpNextCountry();
}
PlayIncorrectSound();
SetUpNextCountry();
}
@ -226,14 +198,10 @@ public class GameManagerRound3 : GameManagerBase
if (NextCountry < 0)
{
// If we ran out of countries, lose the game here.
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)this, NetworkEventTarget.Owner,
nameof(GameHasBeenLost), true);
SendCustomNetworkEvent(NetworkEventTarget.Owner, nameof(GameHasBeenLost), true);
return;
}
NetworkCalling.SendCustomNetworkEvent(
(IUdonEventReceiver)GetCurrentMarker(),
NetworkEventTarget.Owner,
"Activated", true);
GetCurrentMarker().SendCustomNetworkEvent(NetworkEventTarget.Owner, "Activated", true);
UpdateInterface();
}
@ -248,7 +216,7 @@ public class GameManagerRound3 : GameManagerBase
(HostCardBetweenRoundsInterface)GetHostCardInterface(RoundSegmentType.BetweenSegments);
GameWinInterface.HeaderUI.text = "The player has won the game. " + _Timer + " seconds to spare.";
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)_AudioManager, NetworkEventTarget.All,
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All,
"PlaySFXLoop", SFXEventType.CarmenInJail);
SendCustomEventDelayedSeconds(nameof(StopFinalRoundMusic), 1.0f);
@ -258,11 +226,11 @@ public class GameManagerRound3 : GameManagerBase
}
public void StopFinalRoundMusic()
{
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)_AudioManager, NetworkEventTarget.All, "StopMusic");
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, "StopMusic");
}
public void PlayWindDownMusic()
{
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)_AudioManager, NetworkEventTarget.All,
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All,
"PlayMusicLoop", MusicEventType.CarmenSandiegoWindDown);
EnableInteraction("Do It, Rockapella!");
@ -270,7 +238,7 @@ public class GameManagerRound3 : GameManagerBase
}
public void EndCarmenInJailSFX()
{
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)_AudioManager, NetworkEventTarget.All, "StopSFX");
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, "StopSFX");
}
[NetworkCallable]
@ -280,10 +248,7 @@ public class GameManagerRound3 : GameManagerBase
{
for (int i = 0; i < _Markers.Length; i++)
{
NetworkCalling.SendCustomNetworkEvent(
(IUdonEventReceiver)_Markers[i],
NetworkEventTarget.Owner,
"Activated", false);
_Markers[i].SendCustomNetworkEvent(NetworkEventTarget.Owner, "Activated", false);
}
GameStatusUpdate(RanOutOfMarkers ? GameStatus.RanOutOfMarkers : GameStatus.RanOutOfTime);
@ -304,7 +269,7 @@ public class GameManagerRound3 : GameManagerBase
(HostCardBetweenRoundsInterface)GetHostCardInterface(RoundSegmentType.BetweenSegments);
Interface.HeaderUI.text = "Rockin' it acapella";
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)_AudioManager, NetworkEventTarget.All,
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All,
"PlayMusicLoop", MusicEventType.CarmenSandiegoTheme);
EnableInteraction("End Game");
@ -317,7 +282,7 @@ public class GameManagerRound3 : GameManagerBase
(HostCardBetweenRoundsInterface)GetHostCardInterface(RoundSegmentType.BetweenSegments);
Interface.HeaderUI.text = "Game is over. Load a new case file to start again.";
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)_AudioManager, NetworkEventTarget.All, "StopMusic");
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, "StopMusic");
EnableInteraction("Game is over. Load a new case file to start again.");
}
@ -336,13 +301,13 @@ public class GameManagerRound3 : GameManagerBase
public void PlayCorrectSound()
{
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)_AudioManager, NetworkEventTarget.All,
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All,
"PlaySFX", SFXEventType.MapCorrect);
}
public void PlayIncorrectSound()
{
NetworkCalling.SendCustomNetworkEvent((IUdonEventReceiver)_AudioManager, NetworkEventTarget.All,
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All,
"PlaySFX", SFXEventType.MapIncorrect);
}

View File

@ -44,7 +44,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 14
Data: 15
- Name:
Entry: 7
Data:
@ -476,13 +476,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _CollisionCheckCounter
Data: _FailureCounter
- Name: $v
Entry: 7
Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CollisionCheckCounter
Data: _FailureCounter
- Name: <UserType>k__BackingField
Entry: 7
Data: 32|System.RuntimeType, mscorlib
@ -499,8 +499,8 @@ MonoBehaviour:
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
@ -512,7 +512,13 @@ MonoBehaviour:
Data: 33|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 1
- Name:
Entry: 7
Data: 34|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
@ -530,13 +536,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _NoCollisionCounter
Data: _CollisionCheckCounter
- Name: $v
Entry: 7
Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _NoCollisionCounter
Data: _CollisionCheckCounter
- Name: <UserType>k__BackingField
Entry: 9
Data: 32
@ -557,7 +563,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 36|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@ -578,25 +584,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _CollidingLocations
Data: _NoCollisionCounter
- Name: $v
Entry: 7
Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CollidingLocations
Data: _NoCollisionCounter
- Name: <UserType>k__BackingField
Entry: 7
Data: 37|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: 37
Data: 32
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@ -632,19 +632,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _RigidBodyComponent
Data: _CollidingLocations
- Name: $v
Entry: 7
Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _RigidBodyComponent
Data: _CollidingLocations
- Name: <UserType>k__BackingField
Entry: 7
Data: 40|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Rigidbody, UnityEngine.PhysicsModule
Data: VRC.SDK3.Data.DataList, VRCSDK3
- Name:
Entry: 8
Data:
@ -686,25 +686,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _ObjectSync
Data: _RigidBodyComponent
- Name: $v
Entry: 7
Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ObjectSync
Data: _RigidBodyComponent
- Name: <UserType>k__BackingField
Entry: 7
Data: 43|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: 43
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@ -740,25 +740,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _PickupComponent
Data: _ObjectSync
- Name: $v
Entry: 7
Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _PickupComponent
Data: _ObjectSync
- Name: <UserType>k__BackingField
Entry: 7
Data: 46|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: 46
Data: 4
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@ -794,19 +794,19 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _MarkerMesh
Data: _PickupComponent
- Name: $v
Entry: 7
Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _MarkerMesh
Data: _PickupComponent
- Name: <UserType>k__BackingField
Entry: 7
Data: 49|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.MeshRenderer, UnityEngine.CoreModule
Data: VRC.SDK3.Components.VRCPickup, VRCSDK3
- Name:
Entry: 8
Data:
@ -843,6 +843,60 @@ MonoBehaviour:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _MarkerMesh
- Name: $v
Entry: 7
Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _MarkerMesh
- Name: <UserType>k__BackingField
Entry: 7
Data: 52|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.MeshRenderer, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 52
- 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: 53|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

@ -22,6 +22,7 @@ public class FloorMapMarker : UdonSharpBehaviour
[UdonSynced, FieldChangeCallback(nameof(IsLit))] private bool _IsLit = false;
[UdonSynced] private bool _LocationFindingEnabled = false;
[UdonSynced] private int _FailureCounter = 0;
private int _CollisionCheckCounter = 0;
private int _NoCollisionCounter = 0;
private DataList _CollidingLocations = new DataList();
@ -31,6 +32,7 @@ public class FloorMapMarker : UdonSharpBehaviour
private VRCPickup _PickupComponent;
private MeshRenderer _MarkerMesh;
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 float TIME_BETWEEN_REPEAT_COLLISION_CHECKS = 0.15f;
@ -160,7 +162,7 @@ public class FloorMapMarker : UdonSharpBehaviour
bool FoundCorrectResponse = ConfirmChoice(Location.Country, Location.City);
if (FoundCorrectResponse)
{
SendCustomNetworkEvent(NetworkEventTarget.All,
SendCustomNetworkEvent(NetworkEventTarget.Owner,
nameof(SendCorrectResponse), Location.transform.position);
return;
}
@ -175,7 +177,7 @@ public class FloorMapMarker : UdonSharpBehaviour
}
else
{
SendCustomNetworkEvent(NetworkEventTarget.All, nameof(SendIncorrectResponse));
SendCustomNetworkEvent(NetworkEventTarget.Owner, nameof(SendIncorrectResponse));
}
_CollisionCheckCounter++;
}
@ -184,7 +186,7 @@ public class FloorMapMarker : UdonSharpBehaviour
_NoCollisionCounter++;
if (_NoCollisionCounter >= MAX_TIME_WITH_NO_COLLISIONS)
{
SendCustomNetworkEvent(NetworkEventTarget.All, nameof(SendIncorrectResponse));
SendCustomNetworkEvent(NetworkEventTarget.Owner, nameof(SendIncorrectResponse));
}
else
{
@ -213,8 +215,11 @@ public class FloorMapMarker : UdonSharpBehaviour
DisableMovementCompletely(CorrectLocation);
IsLit = true;
Active = false;
RequestSerialization();
_GameManager.PlayCorrectSound();
_GameManager.CorrectResponse();
}
@ -223,15 +228,21 @@ public class FloorMapMarker : UdonSharpBehaviour
{
DisableMovementCompletely();
_GameManager.IncorrectResponse();
_CollisionCheckCounter = 0;
_CollidingLocations.Clear();
_FailureCounter++;
if (_FailureCounter >= MAX_FAILURE_COUNT)
{
Active = false;
_GameManager.IncorrectResponse();
}
_GameManager.PlayIncorrectSound();
RequestSerialization();
}
[NetworkCallable]
public void Activated(bool SetActive)
{
Active = SetActive;