- Location board syncs much more reliably, and with less NetworkCallables.
- Jail chain syncs properly and disables itself, regardless of ownership. - Also did some work with the cameras in round 2.
This commit is contained in:
@@ -44,7 +44,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 21
|
||||
Data: 22
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@@ -902,13 +902,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _ActiveSpinners
|
||||
Data: _RevealedPanel
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _ActiveSpinners
|
||||
Data: _RevealedPanel
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 33
|
||||
@@ -932,13 +932,19 @@ MonoBehaviour:
|
||||
Data: 61|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
Data: 2
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 62|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 63|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
@@ -959,13 +965,13 @@ MonoBehaviour:
|
||||
Data: _OrderIsCorrect
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _OrderIsCorrect
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 64|System.RuntimeType, mscorlib
|
||||
Data: 65|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Boolean[], mscorlib
|
||||
@@ -974,7 +980,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 64
|
||||
Data: 65
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -989,13 +995,13 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 65|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 66|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 66|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||
Data: 67|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -1019,16 +1025,16 @@ MonoBehaviour:
|
||||
Data: _HasBeenCheckedBefore
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _HasBeenCheckedBefore
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 64
|
||||
Data: 65
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 64
|
||||
Data: 65
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1043,13 +1049,13 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 68|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 69|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 69|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||
Data: 70|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -1073,13 +1079,13 @@ MonoBehaviour:
|
||||
Data: _LootMaterial
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 71|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _LootMaterial
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 71|System.RuntimeType, mscorlib
|
||||
Data: 72|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Material, UnityEngine.CoreModule
|
||||
@@ -1088,7 +1094,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 71
|
||||
Data: 72
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1103,13 +1109,13 @@ MonoBehaviour:
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 72|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 73|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 73|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
Data: 74|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -1133,13 +1139,13 @@ MonoBehaviour:
|
||||
Data: _LocationSheetMaterialSelections
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 74|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 75|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _LocationSheetMaterialSelections
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 75|System.RuntimeType, mscorlib
|
||||
Data: 76|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Material[], UnityEngine.CoreModule
|
||||
@@ -1148,7 +1154,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 75
|
||||
Data: 76
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1163,13 +1169,13 @@ MonoBehaviour:
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 76|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 77|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 77|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
Data: 78|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -1193,13 +1199,13 @@ MonoBehaviour:
|
||||
Data: _Animator
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 78|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 79|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _Animator
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 79|System.RuntimeType, mscorlib
|
||||
Data: 80|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Animator, UnityEngine.AnimationModule
|
||||
@@ -1208,7 +1214,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 79
|
||||
Data: 80
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1223,7 +1229,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 80|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 81|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1247,13 +1253,13 @@ MonoBehaviour:
|
||||
Data: _LootImageDownloader
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 81|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 82|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _LootImageDownloader
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 82|System.RuntimeType, mscorlib
|
||||
Data: 83|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.SDK3.Image.VRCImageDownloader, VRCSDK3
|
||||
@@ -1262,7 +1268,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 82
|
||||
Data: 83
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1277,7 +1283,55 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 83|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 84|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: _ActiveSpinners
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 85|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _ActiveSpinners
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 33
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 33
|
||||
- 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: 86|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
|
||||
@@ -30,7 +30,8 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
[UdonSynced, FieldChangeCallback(nameof(Landmarks))] private string[] _Landmarks;
|
||||
[UdonSynced, FieldChangeCallback(nameof(RandomMaterialSettings))] private int[] _RandomMaterialSettings;
|
||||
|
||||
[UdonSynced] private int _ActiveSpinners = 0;
|
||||
[UdonSynced, FieldChangeCallback(nameof(RevealedPanel))] private int _RevealedPanel = 0;
|
||||
|
||||
[UdonSynced] private bool[] _OrderIsCorrect = new bool[3];
|
||||
[UdonSynced] private bool[] _HasBeenCheckedBefore;
|
||||
|
||||
@@ -40,6 +41,8 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
private Animator _Animator;
|
||||
private VRCImageDownloader _LootImageDownloader;
|
||||
|
||||
private int _ActiveSpinners = 0;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
@@ -87,32 +90,41 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
}
|
||||
|
||||
|
||||
[NetworkCallable]
|
||||
public void RevealPanel(int Panel)
|
||||
{
|
||||
RevealedPanel = Panel;
|
||||
RequestSerialization();
|
||||
}
|
||||
|
||||
private void _RevealPanel_Private()
|
||||
{
|
||||
Debug.Log("[LocationBoard] Revealing panel " + RevealedPanel);
|
||||
|
||||
if (_ActiveSpinners < 3)
|
||||
{
|
||||
_Animator.SetBool("Flip " + Panel, true);
|
||||
Debug.Log("[LocationBoard] Active spinners is currently less than three");
|
||||
|
||||
_Animator.SetBool("Flip " + RevealedPanel, true);
|
||||
|
||||
switch (_ActiveSpinners)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
_OrderIsCorrect[0] = (Panel == LootLocation);
|
||||
_OrderIsCorrect[0] = (RevealedPanel == LootLocation);
|
||||
|
||||
if (_OrderIsCorrect[0])
|
||||
{
|
||||
_GameManager.OnTheRightTrack();
|
||||
}
|
||||
else if (Panel == WarrantLocation)
|
||||
else if (RevealedPanel == WarrantLocation)
|
||||
{
|
||||
_GameManager.OutOfOrder(PanelType.Warrant);
|
||||
}
|
||||
else if (Panel == CrookLocation)
|
||||
else if (RevealedPanel == CrookLocation)
|
||||
{
|
||||
_GameManager.OutOfOrder(PanelType.Crook);
|
||||
}
|
||||
else if (_HasBeenCheckedBefore[Panel - 1])
|
||||
else if (_HasBeenCheckedBefore[RevealedPanel - 1])
|
||||
{
|
||||
_GameManager.AlreadyTried();
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 1.0f);
|
||||
@@ -125,7 +137,7 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
} break;
|
||||
case 1:
|
||||
{
|
||||
_OrderIsCorrect[1] = (Panel == WarrantLocation);
|
||||
_OrderIsCorrect[1] = (RevealedPanel == WarrantLocation);
|
||||
|
||||
if (_OrderIsCorrect[1])
|
||||
{
|
||||
@@ -138,15 +150,15 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
_GameManager.AlmostThere();
|
||||
}
|
||||
}
|
||||
else if (Panel == LootLocation)
|
||||
else if (RevealedPanel == LootLocation)
|
||||
{
|
||||
_GameManager.OutOfOrder(PanelType.Loot);
|
||||
}
|
||||
else if (Panel == CrookLocation)
|
||||
else if (RevealedPanel == CrookLocation)
|
||||
{
|
||||
_GameManager.OutOfOrder(PanelType.Crook);
|
||||
}
|
||||
else if (_HasBeenCheckedBefore[Panel - 1])
|
||||
else if (_HasBeenCheckedBefore[RevealedPanel - 1])
|
||||
{
|
||||
if (!_OrderIsCorrect[0])
|
||||
{
|
||||
@@ -166,7 +178,7 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
} break;
|
||||
case 2:
|
||||
{
|
||||
_OrderIsCorrect[2] = (Panel == CrookLocation);
|
||||
_OrderIsCorrect[2] = (RevealedPanel == CrookLocation);
|
||||
|
||||
if (_OrderIsCorrect[2])
|
||||
{
|
||||
@@ -176,17 +188,17 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 2.5f);
|
||||
}
|
||||
}
|
||||
else if (Panel == LootLocation)
|
||||
else if (RevealedPanel == LootLocation)
|
||||
{
|
||||
_GameManager.OutOfOrder(PanelType.Loot);
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 2.5f);
|
||||
}
|
||||
else if (Panel == WarrantLocation)
|
||||
else if (RevealedPanel == WarrantLocation)
|
||||
{
|
||||
_GameManager.OutOfOrder(PanelType.Warrant);
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 2.5f);
|
||||
}
|
||||
else if (_HasBeenCheckedBefore[Panel - 1])
|
||||
else if (_HasBeenCheckedBefore[RevealedPanel - 1])
|
||||
{
|
||||
if (!_OrderIsCorrect[0] || !_OrderIsCorrect[1])
|
||||
{
|
||||
@@ -208,20 +220,17 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
|
||||
_ActiveSpinners++;
|
||||
|
||||
if (Panel == LootLocation || Panel == WarrantLocation || Panel == CrookLocation)
|
||||
if (RevealedPanel == LootLocation)
|
||||
{
|
||||
if (Panel == LootLocation)
|
||||
{
|
||||
_GameManager.SendCustomEventDelayedSeconds("PlayTheLoot", 0.35f);
|
||||
}
|
||||
else if (Panel == WarrantLocation)
|
||||
{
|
||||
_GameManager.SendCustomEventDelayedSeconds("PlayTheWarrant", 0.35f);
|
||||
}
|
||||
else if (Panel == CrookLocation)
|
||||
{
|
||||
_GameManager.SendCustomEventDelayedSeconds("PlayTheCrookTheme", 0.35f);
|
||||
}
|
||||
_GameManager.SendCustomEventDelayedSeconds("PlayTheLoot", 0.35f);
|
||||
}
|
||||
else if (RevealedPanel == WarrantLocation)
|
||||
{
|
||||
_GameManager.SendCustomEventDelayedSeconds("PlayTheWarrant", 0.35f);
|
||||
}
|
||||
else if (RevealedPanel == CrookLocation)
|
||||
{
|
||||
_GameManager.SendCustomEventDelayedSeconds("PlayTheCrookTheme", 0.35f);
|
||||
}
|
||||
|
||||
if (_OrderIsCorrect[0] && _OrderIsCorrect[1] && _OrderIsCorrect[2])
|
||||
@@ -230,14 +239,18 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
_HasBeenCheckedBefore[Panel - 1] = true;
|
||||
_HasBeenCheckedBefore[RevealedPanel - 1] = true;
|
||||
}
|
||||
|
||||
|
||||
public void InitiateBoardReset() { _GameManager.LocationBoardReset(true); }
|
||||
|
||||
[NetworkCallable]
|
||||
public void ResetPanelBoard()
|
||||
{
|
||||
RevealedPanel = 0;
|
||||
RequestSerialization();
|
||||
}
|
||||
private void _ResetPanelBoard_Private()
|
||||
{
|
||||
for (int i = 1; i <= 15; i++)
|
||||
{
|
||||
@@ -425,4 +438,22 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
}
|
||||
get => _RandomMaterialSettings;
|
||||
}
|
||||
|
||||
|
||||
private int RevealedPanel
|
||||
{
|
||||
set
|
||||
{
|
||||
_RevealedPanel = value;
|
||||
if (_RevealedPanel > 0)
|
||||
{
|
||||
_RevealPanel_Private();
|
||||
}
|
||||
else
|
||||
{
|
||||
_ResetPanelBoard_Private();
|
||||
}
|
||||
}
|
||||
get => _RevealedPanel;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user