Tiebreaker data no longer needs to be downloaded each time it's rerolled.
This commit is contained in:
parent
1f8eeadb08
commit
2691d9be22
@ -88105,7 +88105,7 @@ PrefabInstance:
|
||||
- target: {fileID: 904799891945447993, guid: f6465f2b41241f04a9645838d2b9d511,
|
||||
type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
|
||||
value: BeginTiebreakerRound
|
||||
value: ReloadTiebreakerData
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 904799891945447993, guid: f6465f2b41241f04a9645838d2b9d511,
|
||||
type: 3}
|
||||
|
||||
@ -44,7 +44,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 39
|
||||
Data: 41
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@ -2385,6 +2385,110 @@ MonoBehaviour:
|
||||
- Name:
|
||||
Entry: 8
|
||||
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:
|
||||
Entry: 13
|
||||
Data:
|
||||
|
||||
@ -65,6 +65,8 @@ public class GameManagerRound1 : GameManagerBase
|
||||
private CameraControllerRound1 _CameraControllerRound1 = null;
|
||||
|
||||
private float _VideoPlayerTimer = -1.0f;
|
||||
private string _TiebreakerJSONString = "";
|
||||
private int _TiebreakerLoadAttempts = 0;
|
||||
|
||||
|
||||
void Start()
|
||||
@ -1485,6 +1487,8 @@ public class GameManagerRound1 : GameManagerBase
|
||||
{
|
||||
_CurrentQuestionType = RoundSegmentType.Tiebreaker;
|
||||
|
||||
LoadTiebreakerData();
|
||||
|
||||
EnableInteraction("Advance To Tiebreaker");
|
||||
}
|
||||
else
|
||||
@ -1535,23 +1539,36 @@ public class GameManagerRound1 : GameManagerBase
|
||||
}
|
||||
|
||||
|
||||
public void BeginTiebreakerRound()
|
||||
private void BeginTiebreakerRound()
|
||||
{
|
||||
HostCardBetweenRoundsInterface Interface =
|
||||
(HostCardBetweenRoundsInterface)GetHostCardInterface(RoundSegmentType.BetweenSegments);
|
||||
Interface.HeaderUI.text = "Preparing tiebreaker...";
|
||||
Interface.CommentUI.text = "";
|
||||
if (_TiebreakerJSONString == "")
|
||||
{
|
||||
HostCardBetweenRoundsInterface BetweenSegmentsInterface =
|
||||
(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)GetHostCardInterface(RoundSegmentType.Tiebreaker);
|
||||
|
||||
string ErrorString = "";
|
||||
string JSONString = TiebreakerString.Result;
|
||||
if (VRCJson.TryDeserializeFromJson(JSONString, out DataToken JSONResult))
|
||||
if (VRCJson.TryDeserializeFromJson(_TiebreakerJSONString, out DataToken JSONResult))
|
||||
{
|
||||
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()
|
||||
{
|
||||
_VideoPlayer.ShowScreen = ClueScreenType.Blank;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user