Compare commits
2 Commits
main
...
player-ran
| Author | SHA1 | Date | |
|---|---|---|---|
| f0d37d1a90 | |||
| 2691d9be22 |
@ -88105,7 +88105,7 @@ PrefabInstance:
|
|||||||
- target: {fileID: 904799891945447993, guid: f6465f2b41241f04a9645838d2b9d511,
|
- target: {fileID: 904799891945447993, guid: f6465f2b41241f04a9645838d2b9d511,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
|
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
|
||||||
value: BeginTiebreakerRound
|
value: ReloadTiebreakerData
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 904799891945447993, guid: f6465f2b41241f04a9645838d2b9d511,
|
- target: {fileID: 904799891945447993, guid: f6465f2b41241f04a9645838d2b9d511,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
|||||||
@ -44,7 +44,7 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 39
|
Data: 41
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data:
|
Data:
|
||||||
@ -2385,6 +2385,110 @@ MonoBehaviour:
|
|||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 7
|
||||||
|
Data:
|
||||||
|
- Name: $k
|
||||||
|
Entry: 1
|
||||||
|
Data: _TiebreakerJSONString
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 152|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: _TiebreakerJSONString
|
||||||
|
- Name: <UserType>k__BackingField
|
||||||
|
Entry: 7
|
||||||
|
Data: 153|System.RuntimeType, mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 1
|
||||||
|
Data: System.String, mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name: <SystemType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 153
|
||||||
|
- 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: 154|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: 7
|
||||||
|
Data:
|
||||||
|
- Name: $k
|
||||||
|
Entry: 1
|
||||||
|
Data: _TiebreakerLoadAttempts
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 155|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: _TiebreakerLoadAttempts
|
||||||
|
- Name: <UserType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 57
|
||||||
|
- Name: <SystemType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 57
|
||||||
|
- 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: 156|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:
|
- Name:
|
||||||
Entry: 13
|
Entry: 13
|
||||||
Data:
|
Data:
|
||||||
|
|||||||
@ -65,6 +65,8 @@ public class GameManagerRound1 : GameManagerBase
|
|||||||
private CameraControllerRound1 _CameraControllerRound1 = null;
|
private CameraControllerRound1 _CameraControllerRound1 = null;
|
||||||
|
|
||||||
private float _VideoPlayerTimer = -1.0f;
|
private float _VideoPlayerTimer = -1.0f;
|
||||||
|
private string _TiebreakerJSONString = "";
|
||||||
|
private int _TiebreakerLoadAttempts = 0;
|
||||||
|
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
@ -1311,6 +1313,8 @@ public class GameManagerRound1 : GameManagerBase
|
|||||||
int DecodedPlayerNumber = 1000 - (ScoresList[i].Int % 1000);
|
int DecodedPlayerNumber = 1000 - (ScoresList[i].Int % 1000);
|
||||||
_FinalRoundPlayersSortedByScore[_FinalRoundPlayersSortedByScore.Length - i - 1] = DecodedPlayerNumber;
|
_FinalRoundPlayersSortedByScore[_FinalRoundPlayersSortedByScore.Length - i - 1] = DecodedPlayerNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RequestSerialization();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FinalRoundRevealPlayerPlace(int PlayerPlace)
|
private void FinalRoundRevealPlayerPlace(int PlayerPlace)
|
||||||
@ -1370,13 +1374,11 @@ public class GameManagerRound1 : GameManagerBase
|
|||||||
HostCardBetweenRoundsInterface Interface =
|
HostCardBetweenRoundsInterface Interface =
|
||||||
(HostCardBetweenRoundsInterface)GetHostCardInterface(RoundSegmentType.BetweenSegments);
|
(HostCardBetweenRoundsInterface)GetHostCardInterface(RoundSegmentType.BetweenSegments);
|
||||||
|
|
||||||
PlayerPodium Number1Podium = _PlayerPodiums[_FinalRoundPlayersSortedByScore[0] - 1];
|
PlayerPodium[] SortedPodiums = new PlayerPodium[_PlayerPodiums.Length];
|
||||||
PlayerPodium Number2Podium = _PlayerPodiums[_FinalRoundPlayersSortedByScore[1] - 1];
|
for (int i = 0; i < _PlayerPodiums.Length; i++)
|
||||||
PlayerPodium Number3Podium = _PlayerPodiums[_FinalRoundPlayersSortedByScore[2] - 1];
|
{
|
||||||
|
SortedPodiums[i] = _PlayerPodiums[_FinalRoundPlayersSortedByScore[i] - 1];
|
||||||
VRCPlayerApi Number1 = Networking.GetOwner(Number1Podium.gameObject);
|
}
|
||||||
VRCPlayerApi Number2 = Networking.GetOwner(Number2Podium.gameObject);
|
|
||||||
VRCPlayerApi Number3 = Networking.GetOwner(Number3Podium.gameObject);
|
|
||||||
|
|
||||||
bool TiebreakerNeeded = false;
|
bool TiebreakerNeeded = false;
|
||||||
if (SortedPlayerScores[1] == SortedPlayerScores[2])
|
if (SortedPlayerScores[1] == SortedPlayerScores[2])
|
||||||
@ -1384,17 +1386,17 @@ public class GameManagerRound1 : GameManagerBase
|
|||||||
if (SortedPlayerScores[0] == SortedPlayerScores[1])
|
if (SortedPlayerScores[0] == SortedPlayerScores[1])
|
||||||
{
|
{
|
||||||
Interface.HeaderUI.text = "Three-Way Tie.";
|
Interface.HeaderUI.text = "Three-Way Tie.";
|
||||||
Interface.CommentUI.text = "We'll start with a tiebreaker between " + Number2.displayName + " and " + Number3.displayName + ".";
|
Interface.CommentUI.text = "We'll start with a tiebreaker between " + SortedPodiums[1].PlayerName + " and " + SortedPodiums[2].PlayerName + ".";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Interface.HeaderUI.text = Number1.displayName + " Wins";
|
Interface.HeaderUI.text = SortedPodiums[0].PlayerName + " Wins";
|
||||||
Interface.CommentUI.text =
|
Interface.CommentUI.text =
|
||||||
"- " + Number1.displayName + " will be moving on to the next round.\n" +
|
"- " + SortedPodiums[0].PlayerName + " will be moving on to the next round.\n" +
|
||||||
"- There is a tie for second place between " + Number2.displayName + " and " + Number3.displayName + ", so we will move on to a tiebreaker.";
|
"- There is a tie for second place between " + SortedPodiums[1].PlayerName + " and " + SortedPodiums[2].PlayerName + ", so we will move on to a tiebreaker.";
|
||||||
}
|
}
|
||||||
TiebreakerNeeded = true;
|
TiebreakerNeeded = true;
|
||||||
PrepareTiebreakerRound(Number2Podium.PlayerNumber, Number3Podium.PlayerNumber);
|
PrepareTiebreakerRound(SortedPodiums[1].PlayerNumber, SortedPodiums[2].PlayerNumber);
|
||||||
|
|
||||||
_CameraControllerRound1.ActivateHostAllPlayersCameraSwitcher();
|
_CameraControllerRound1.ActivateHostAllPlayersCameraSwitcher();
|
||||||
}
|
}
|
||||||
@ -1406,26 +1408,26 @@ public class GameManagerRound1 : GameManagerBase
|
|||||||
{
|
{
|
||||||
Random.InitState(Networking.GetServerTimeInMilliseconds());
|
Random.InitState(Networking.GetServerTimeInMilliseconds());
|
||||||
|
|
||||||
VRCPlayerApi[] Randomiser = new VRCPlayerApi[2];
|
string[] Randomiser = new string[2];
|
||||||
Randomiser[0] = Number1;
|
Randomiser[0] = SortedPodiums[0].PlayerName;
|
||||||
Randomiser[1] = Number2;
|
Randomiser[1] = SortedPodiums[1].PlayerName;
|
||||||
int RandomIndex = Random.Range(0, 2);
|
int RandomIndex = Random.Range(0, Randomiser.Length);
|
||||||
|
|
||||||
WinningPlayers[0] = Randomiser[RandomIndex].displayName;
|
WinningPlayers[0] = Randomiser[RandomIndex];
|
||||||
WinningPlayers[1] = Randomiser[(RandomIndex + 1) % 2].displayName;
|
WinningPlayers[1] = Randomiser[(RandomIndex + 1) % Randomiser.Length];
|
||||||
|
|
||||||
Interface.HeaderUI.text = "Tie For First";
|
Interface.HeaderUI.text = "Tie For First";
|
||||||
Interface.CommentUI.text =
|
Interface.CommentUI.text =
|
||||||
"- " + Number1.displayName + " and " + Number2.displayName + " are tied for first place.\n" +
|
"- " + SortedPodiums[0].PlayerName + " and " + SortedPodiums[1].PlayerName + " are tied for first place.\n" +
|
||||||
"- Both will move on to the next round.";
|
"- Both will move on to the next round.";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WinningPlayers[0] = Number1.displayName;
|
WinningPlayers[0] = SortedPodiums[0].PlayerName;
|
||||||
WinningPlayers[1] = Number2.displayName;
|
WinningPlayers[1] = SortedPodiums[1].PlayerName;
|
||||||
|
|
||||||
Interface.HeaderUI.text = "Winners";
|
Interface.HeaderUI.text = "Winners";
|
||||||
Interface.CommentUI.text = Number1.displayName + " and " + Number2.displayName + " will move on to the next round.";
|
Interface.CommentUI.text = SortedPodiums[0].PlayerName + " and " + SortedPodiums[1].PlayerName + " will move on to the next round.";
|
||||||
}
|
}
|
||||||
|
|
||||||
_CaseManager.SetCurrentWinningPlayers(WinningPlayers);
|
_CaseManager.SetCurrentWinningPlayers(WinningPlayers);
|
||||||
@ -1485,6 +1487,8 @@ public class GameManagerRound1 : GameManagerBase
|
|||||||
{
|
{
|
||||||
_CurrentQuestionType = RoundSegmentType.Tiebreaker;
|
_CurrentQuestionType = RoundSegmentType.Tiebreaker;
|
||||||
|
|
||||||
|
LoadTiebreakerData();
|
||||||
|
|
||||||
EnableInteraction("Advance To Tiebreaker");
|
EnableInteraction("Advance To Tiebreaker");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1535,23 +1539,36 @@ public class GameManagerRound1 : GameManagerBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void BeginTiebreakerRound()
|
private void BeginTiebreakerRound()
|
||||||
{
|
{
|
||||||
HostCardBetweenRoundsInterface Interface =
|
if (_TiebreakerJSONString == "")
|
||||||
(HostCardBetweenRoundsInterface)GetHostCardInterface(RoundSegmentType.BetweenSegments);
|
{
|
||||||
Interface.HeaderUI.text = "Preparing tiebreaker...";
|
HostCardBetweenRoundsInterface BetweenSegmentsInterface =
|
||||||
Interface.CommentUI.text = "";
|
(HostCardBetweenRoundsInterface)GetHostCardInterface(RoundSegmentType.BetweenSegments);
|
||||||
|
BetweenSegmentsInterface.HeaderUI.text = "Preparing tiebreaker...";
|
||||||
|
BetweenSegmentsInterface.CommentUI.text = "";
|
||||||
|
|
||||||
VRCStringDownloader.LoadUrl(_TiebreakerData, (IUdonEventReceiver)this);
|
_TiebreakerLoadAttempts++;
|
||||||
|
if (_TiebreakerLoadAttempts >= 3)
|
||||||
|
{
|
||||||
|
BetweenSegmentsInterface.CommentUI.text = $"[ERROR] Failed to load tiebreaker after {_TiebreakerLoadAttempts} attempts.";
|
||||||
|
EnableInteraction();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SendCustomEventDelayedSeconds(nameof(BeginTiebreakerRound), 1.0f);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReloadTiebreakerData();
|
||||||
}
|
}
|
||||||
public override void OnStringLoadSuccess(IVRCStringDownload TiebreakerString)
|
public void ReloadTiebreakerData()
|
||||||
{
|
{
|
||||||
HostCardTiebreakerInterface Interface =
|
HostCardTiebreakerInterface Interface =
|
||||||
(HostCardTiebreakerInterface)GetHostCardInterface(RoundSegmentType.Tiebreaker);
|
(HostCardTiebreakerInterface)GetHostCardInterface(RoundSegmentType.Tiebreaker);
|
||||||
|
|
||||||
string ErrorString = "";
|
string ErrorString = "";
|
||||||
string JSONString = TiebreakerString.Result;
|
if (VRCJson.TryDeserializeFromJson(_TiebreakerJSONString, out DataToken JSONResult))
|
||||||
if (VRCJson.TryDeserializeFromJson(JSONString, out DataToken JSONResult))
|
|
||||||
{
|
{
|
||||||
if (JSONResult.TokenType == TokenType.DataDictionary)
|
if (JSONResult.TokenType == TokenType.DataDictionary)
|
||||||
{
|
{
|
||||||
@ -2068,6 +2085,18 @@ public class GameManagerRound1 : GameManagerBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LoadTiebreakerData()
|
||||||
|
{
|
||||||
|
_TiebreakerJSONString = "";
|
||||||
|
_TiebreakerLoadAttempts = 0;
|
||||||
|
VRCStringDownloader.LoadUrl(_TiebreakerData, (IUdonEventReceiver)this);
|
||||||
|
}
|
||||||
|
public override void OnStringLoadSuccess(IVRCStringDownload TiebreakerString)
|
||||||
|
{
|
||||||
|
_TiebreakerJSONString = TiebreakerString.Result;
|
||||||
|
_TiebreakerLoadAttempts = 0;
|
||||||
|
}
|
||||||
|
|
||||||
private HostCardBetweenRoundsInterface ShowBetweenQuestionsInterface()
|
private HostCardBetweenRoundsInterface ShowBetweenQuestionsInterface()
|
||||||
{
|
{
|
||||||
_VideoPlayer.ShowScreen = ClueScreenType.Blank;
|
_VideoPlayer.ShowScreen = ClueScreenType.Blank;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user