- Finished animations for the location board.
- Reorganised a bunch of source files.
This commit is contained in:
@@ -0,0 +1,233 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: GameManagerBase
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: aa097bd5d9294a14cab8d8fdce153342,
|
||||
type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
sourceCsScript: {fileID: 11500000, guid: e4b93753856e7ca48877947cbe074749, type: 3}
|
||||
scriptVersion: 2
|
||||
compiledVersion: 2
|
||||
behaviourSyncMode: 0
|
||||
hasInteractEvent: 0
|
||||
scriptID: -4259654259815039154
|
||||
serializationData:
|
||||
SerializedFormat: 2
|
||||
SerializedBytes:
|
||||
ReferencedUnityObjects: []
|
||||
SerializedBytesString:
|
||||
Prefab: {fileID: 0}
|
||||
PrefabModificationsReferencedUnityObjects: []
|
||||
PrefabModifications: []
|
||||
SerializationNodes:
|
||||
- Name: fieldDefinitions
|
||||
Entry: 7
|
||||
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
|
||||
UdonSharp.Editor]], mscorlib
|
||||
- Name: comparer
|
||||
Entry: 7
|
||||
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
|
||||
mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 3
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _HostCard
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _HostCard
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 3|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: HostCardManager, Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 4|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.Udon.UdonBehaviour, VRC.Udon
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- 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: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 6|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- 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: _QuestionURL
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _QuestionURL
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 8|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.SDKBase.VRCUrl, VRCSDKBase
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- 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: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 10|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- 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: _AllowInteractionFromHostCard
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _AllowInteractionFromHostCard
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 12|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Boolean, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 12
|
||||
- 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: 13|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:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 58f4439ac4c3e9c438e2513925202b8c
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,169 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDK3.Data;
|
||||
using VRC.SDK3.StringLoading;
|
||||
using VRC.SDK3.UdonNetworkCalling;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon.Common.Interfaces;
|
||||
using VRC.Udon.Serialization.OdinSerializer.Utilities;
|
||||
|
||||
|
||||
public enum QuestionType
|
||||
{
|
||||
BetweenRounds,
|
||||
MultipleChoice,
|
||||
LightningRound,
|
||||
DumpsterDive,
|
||||
TheChase,
|
||||
FinalRound,
|
||||
Tiebreaker
|
||||
}
|
||||
|
||||
public enum MusicEventType
|
||||
{
|
||||
None,
|
||||
TheChase,
|
||||
ThinkAboutIt,
|
||||
WhereInTheWorld,
|
||||
RockapellaIdent
|
||||
}
|
||||
|
||||
public enum SFXEventType
|
||||
{
|
||||
None,
|
||||
Ding,
|
||||
Buzzer
|
||||
}
|
||||
|
||||
|
||||
public class GameManagerBase : UdonSharpBehaviour
|
||||
{
|
||||
[UdonSynced] protected bool _GameHasBegun = false;
|
||||
|
||||
[SerializeField] protected HostCardManager _HostCard = null;
|
||||
|
||||
[SerializeField] protected VRCUrl _QuestionURL;
|
||||
|
||||
private bool _AllowInteractionFromHostCard = false;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
InitialiseGameMode();
|
||||
}
|
||||
|
||||
protected void EnableInteraction(string NextInteraction = "Advance")
|
||||
{
|
||||
_AllowInteractionFromHostCard = true;
|
||||
_HostCard.SetNextInteractionText(NextInteraction);
|
||||
}
|
||||
protected void DisableInteraction()
|
||||
{
|
||||
_AllowInteractionFromHostCard = false;
|
||||
}
|
||||
|
||||
public bool IsInteractionEnabled()
|
||||
{
|
||||
return _AllowInteractionFromHostCard;
|
||||
}
|
||||
|
||||
public void HostCardUseButtonDown()
|
||||
{
|
||||
if (!IsInteractionEnabled()) { return; }
|
||||
|
||||
_HostCardUseButtonDown_Internal();
|
||||
}
|
||||
|
||||
protected HostCardInterfaceBase GetHostCardInterface(QuestionType Type)
|
||||
{
|
||||
return _HostCard.EnableHostCardDisplay(Type);
|
||||
}
|
||||
|
||||
protected virtual void _HostCardUseButtonDown_Internal()
|
||||
{
|
||||
Debug.LogError("You should not be seeing this. You don't need to call base._HostCardUseButtonDown_Internal()");
|
||||
}
|
||||
|
||||
|
||||
protected virtual void InitialiseGameMode()
|
||||
{
|
||||
// Download our test question.
|
||||
VRCStringDownloader.LoadUrl(_QuestionURL, (IUdonEventReceiver)this);
|
||||
}
|
||||
|
||||
|
||||
public override void OnStringLoadSuccess(IVRCStringDownload DownloadedString)
|
||||
{
|
||||
string ErrorString = "";
|
||||
string JSONString = DownloadedString.Result;
|
||||
if (VRCJson.TryDeserializeFromJson(JSONString, out DataToken JSONResult))
|
||||
{
|
||||
if (JSONResult.TokenType == TokenType.DataDictionary)
|
||||
{
|
||||
DataDictionary Dict = JSONResult.DataDictionary;
|
||||
|
||||
if (!Dict.ContainsKey("Round 1") || !Dict.ContainsKey("Round 2") || !Dict.ContainsKey("Round 3"))
|
||||
{
|
||||
ErrorString = "Could not find all the necessary keys for game rounds.";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Attempt to load Round 1 data
|
||||
if (Dict["Round 1"].TokenType == TokenType.DataList)
|
||||
{
|
||||
LoadQuestionData(Dict["Round 1"].DataList);
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorString = "Ensure the 'Round 1' entry is an array of dictionaries.";
|
||||
}
|
||||
|
||||
// Attempt to load Round 2 data
|
||||
if (Dict["Round 2"].TokenType == TokenType.DataList)
|
||||
{
|
||||
// LoadQuestionData(Dict["Round 2"].DataList);
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorString = "Ensure the 'Round 2' entry is a dictionary with a location name and landmarks.";
|
||||
}
|
||||
|
||||
// Attempt to load Round 2 data
|
||||
if (Dict["Round 3"].TokenType == TokenType.DataList)
|
||||
{
|
||||
// LoadQuestionData(Dict["Round 3"].DataList);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ErrorString = "Ensure the 'Round 3' dictionary entry is a list of dictionaries.";
|
||||
}
|
||||
}
|
||||
|
||||
if (Dict.ContainsKey("Round 1"))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorString = "Ensure the first element is a dictionary, containing 'Round 1', 'Round 2', and 'Round 3' entries.";
|
||||
}
|
||||
|
||||
if (Dict.ContainsKey("Round 2"))
|
||||
{
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorString = "Ensure the first element is a dictionary";
|
||||
}
|
||||
}
|
||||
|
||||
if (ErrorString != "")
|
||||
{
|
||||
Debug.LogError("Malformed case file. " + ErrorString);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void LoadQuestionData(DataList Data) {}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e4b93753856e7ca48877947cbe074749
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 181b02f36de68294ca7e73c11b84b197
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f74a37881105b744bd2d7931cc9915f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDK3.Data;
|
||||
using VRC.SDK3.UdonNetworkCalling;
|
||||
using VRC.Udon.Common.Interfaces;
|
||||
using VRC.SDKBase;
|
||||
|
||||
|
||||
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
|
||||
public class GameManagerRound2 : GameManagerBase
|
||||
{
|
||||
protected override void InitialiseGameMode()
|
||||
{
|
||||
|
||||
|
||||
base.InitialiseGameMode();
|
||||
}
|
||||
|
||||
|
||||
protected override void LoadQuestionData(DataList Data)
|
||||
{
|
||||
_QuestionsList.Clear();
|
||||
_QuestionIndex = 0;
|
||||
|
||||
HostCardBetweenRoundsInterface Interface =
|
||||
(HostCardBetweenRoundsInterface)GetHostCardInterface(QuestionType.BetweenRounds);
|
||||
|
||||
for (int i = 0; i < Data.Count; i++)
|
||||
{
|
||||
if (Data[i].TokenType == TokenType.DataDictionary)
|
||||
{
|
||||
_QuestionsList.Add(Data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (_QuestionsList.Count == 0)
|
||||
{
|
||||
Interface.HeaderUI.text =
|
||||
"Unable to find any questions. Ensure the root array elements are all objects.";
|
||||
return;
|
||||
}
|
||||
|
||||
_CurrentQuestion = _QuestionsList[_QuestionIndex].DataDictionary;
|
||||
|
||||
Interface.HeaderUI.text =
|
||||
"Found " + _QuestionsList.Count + " questions in this case file. Press 'Use' button to show scores.";
|
||||
|
||||
// Reset podiums on a successful case load
|
||||
for (int i = 0; i < _PlayerPodiums.Length; i++)
|
||||
{
|
||||
NetworkCalling.SendCustomNetworkEvent(
|
||||
(IUdonEventReceiver)_PlayerPodiums[i],
|
||||
NetworkEventTarget.All,
|
||||
"ResetPodium");
|
||||
}
|
||||
|
||||
_GameHasBegun = false;
|
||||
EnableInteraction("Start Game");
|
||||
}
|
||||
|
||||
|
||||
protected override void _HostCardUseButtonDown_Internal()
|
||||
{
|
||||
if (!_GameHasBegun)
|
||||
{
|
||||
for (int i = 0; i < _PlayerPodiums.Length; i++)
|
||||
{
|
||||
NetworkCalling.SendCustomNetworkEvent(
|
||||
(IUdonEventReceiver)_PlayerPodiums[i],
|
||||
NetworkEventTarget.All,
|
||||
"DisplayScore");
|
||||
}
|
||||
|
||||
SendCustomNetworkEvent(NetworkEventTarget.All, nameof(PlaySFXAtPitch), SFXEventType.Ding, D6);
|
||||
|
||||
HostCardBetweenRoundsInterface Interface =
|
||||
(HostCardBetweenRoundsInterface)GetHostCardInterface(QuestionType.BetweenRounds);
|
||||
Interface.HeaderUI.text = "Upcoming Question: " + QuestionTypeToString((QuestionType)((int)_CurrentQuestion["Type"].Number));
|
||||
|
||||
_GameHasBegun = true;
|
||||
return;
|
||||
}
|
||||
|
||||
AdvanceQuestion();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aff7dcb877dc27a4ab2fd77cf366a3b8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user