- Floor markers now properly detect correct/incorrect placements.

- Implemented correct/incorrect sounds.
This commit is contained in:
Jamie Greunbaum 2025-06-22 04:44:30 -04:00
parent 6cb81308f7
commit 557ec5b239
8 changed files with 3901 additions and 243 deletions

View File

@ -54,7 +54,7 @@ SphereCollider:
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.25
m_Radius: 0.05
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &1902543354252190736
MonoBehaviour:

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 22
Data: 24
- Name:
Entry: 7
Data:
@ -728,13 +728,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _CrookTheme_Contessa
Data: _MapCorrect
- Name: $v
Entry: 7
Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CrookTheme_Contessa
Data: _MapCorrect
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
@ -756,126 +756,126 @@ MonoBehaviour:
- Name: _fieldAttributes
Entry: 7
Data: 43|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 44|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: _MapIncorrect
- Name: $v
Entry: 7
Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _MapIncorrect
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
- Name: <SystemType>k__BackingField
Entry: 9
Data: 10
- 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: 46|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 47|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: _CrookTheme_Contessa
- Name: $v
Entry: 7
Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CrookTheme_Contessa
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
- Name: <SystemType>k__BackingField
Entry: 9
Data: 10
- 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: 49|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 2
- Name:
Entry: 7
Data: 44|UnityEngine.HeaderAttribute, UnityEngine.CoreModule
Data: 50|UnityEngine.HeaderAttribute, UnityEngine.CoreModule
- Name: header
Entry: 1
Data: Crook Themes
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 45|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: _CrookTheme_DoubleTrouble
- Name: $v
Entry: 7
Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CrookTheme_DoubleTrouble
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
- Name: <SystemType>k__BackingField
Entry: 9
Data: 10
- 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: 47|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 48|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: _CrookTheme_EarthaBrute
- Name: $v
Entry: 7
Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CrookTheme_EarthaBrute
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
- Name: <SystemType>k__BackingField
Entry: 9
Data: 10
- 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: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 51|UnityEngine.SerializeField, UnityEngine.CoreModule
@ -899,13 +899,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _CrookTheme_Kneemoi
Data: _CrookTheme_DoubleTrouble
- Name: $v
Entry: 7
Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CrookTheme_Kneemoi
Data: _CrookTheme_DoubleTrouble
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
@ -953,13 +953,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _CrookTheme_PattyLarceny
Data: _CrookTheme_EarthaBrute
- Name: $v
Entry: 7
Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CrookTheme_PattyLarceny
Data: _CrookTheme_EarthaBrute
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
@ -1007,13 +1007,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _CrookTheme_Robocrook
Data: _CrookTheme_Kneemoi
- Name: $v
Entry: 7
Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CrookTheme_Robocrook
Data: _CrookTheme_Kneemoi
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
@ -1061,13 +1061,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _CrookTheme_SarahNade
Data: _CrookTheme_PattyLarceny
- Name: $v
Entry: 7
Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CrookTheme_SarahNade
Data: _CrookTheme_PattyLarceny
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
@ -1115,13 +1115,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _CrookTheme_TopGrunge
Data: _CrookTheme_Robocrook
- Name: $v
Entry: 7
Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CrookTheme_TopGrunge
Data: _CrookTheme_Robocrook
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
@ -1169,13 +1169,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _CrookTheme_VicTheSlick
Data: _CrookTheme_SarahNade
- Name: $v
Entry: 7
Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CrookTheme_VicTheSlick
Data: _CrookTheme_SarahNade
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
@ -1223,13 +1223,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _CrookTheme_WonderRat
Data: _CrookTheme_TopGrunge
- Name: $v
Entry: 7
Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CrookTheme_WonderRat
Data: _CrookTheme_TopGrunge
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
@ -1272,6 +1272,114 @@ MonoBehaviour:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _CrookTheme_VicTheSlick
- Name: $v
Entry: 7
Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CrookTheme_VicTheSlick
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
- Name: <SystemType>k__BackingField
Entry: 9
Data: 10
- 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: 74|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 75|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: _CrookTheme_WonderRat
- Name: $v
Entry: 7
Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CrookTheme_WonderRat
- Name: <UserType>k__BackingField
Entry: 9
Data: 10
- Name: <SystemType>k__BackingField
Entry: 9
Data: 10
- 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: 77|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 78|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: 13
Data:

View File

@ -24,7 +24,10 @@ public enum SFXEventType
TheLoot,
TheWarrant,
InJail
InJail,
MapCorrect,
MapIncorrect
}
@ -49,6 +52,9 @@ public class AudioManager : UdonSharpBehaviour
[SerializeField] private AudioClip _TheWarrant = null;
[SerializeField] private AudioClip _InJail = null;
[SerializeField] private AudioClip _MapCorrect = null;
[SerializeField] private AudioClip _MapIncorrect = null;
[Header("Crook Themes")]
[SerializeField] private AudioClip _CrookTheme_Contessa = null;
[SerializeField] private AudioClip _CrookTheme_DoubleTrouble = null;
@ -119,14 +125,17 @@ public class AudioManager : UdonSharpBehaviour
switch (SFXEvent)
{
case SFXEventType.Ding: _SFXPlayer.clip = _Ding; break;
case SFXEventType.Buzzer: _SFXPlayer.clip = _Buzzer; break;
case SFXEventType.Ding: _SFXPlayer.clip = _Ding; break;
case SFXEventType.Buzzer: _SFXPlayer.clip = _Buzzer; break;
case SFXEventType.TheLoot: _SFXPlayer.clip = _TheLoot; break;
case SFXEventType.TheWarrant: _SFXPlayer.clip = _TheWarrant; break;
case SFXEventType.InJail: _SFXPlayer.clip = _InJail; break;
case SFXEventType.TheLoot: _SFXPlayer.clip = _TheLoot; break;
case SFXEventType.TheWarrant: _SFXPlayer.clip = _TheWarrant; break;
case SFXEventType.InJail: _SFXPlayer.clip = _InJail; break;
default: _SFXPlayer.clip = null; break;
case SFXEventType.MapCorrect: _SFXPlayer.clip = _MapCorrect; break;
case SFXEventType.MapIncorrect: _SFXPlayer.clip = _MapIncorrect; break;
default: _SFXPlayer.clip = null; break;
}
if (_SFXPlayer.clip != null)

View File

@ -2,10 +2,6 @@
using UdonSharp;
using UnityEngine;
using VRC.SDK3.Data;
using VRC.SDK3.UdonNetworkCalling;
using VRC.Udon.Common.Interfaces;
using VRC.SDKBase;
using System.Linq.Expressions;
public enum ContinentMap
@ -27,7 +23,7 @@ public class GameManagerRound3 : GameManagerBase
[SerializeField] private AudioManager _AudioManager;
private ContinentMap _ActiveMap;
private ContinentMap _ActiveMap = ContinentMap.Africa;
private DataDictionary _ContinentData;
private int _StageIndex = 0;
@ -46,10 +42,14 @@ public class GameManagerRound3 : GameManagerBase
if (_ContinentData.ContainsKey("Continent"))
{
_ActiveMap = (ContinentMap)_ContinentData["Continent"].Number;
_ActiveMap = (ContinentMap)(int)_ContinentData["Continent"].Number;
for (int i = 0; i < _Maps.Length; i++)
{
//_Maps[i].gameObject.SetActive(i == (int)_ActiveMap);
FloorMap Map = _Maps[(int)_ActiveMap];
if (Map != null)
{
Map.gameObject.SetActive(i == (int)_ActiveMap);
}
}
}
else
@ -69,15 +69,14 @@ public class GameManagerRound3 : GameManagerBase
}
public bool ConfirmChoice(string Country, string City)
public string GetCurrentCountry()
{
if (Country == _Maps[(int)_ActiveMap].GetCurrentCountry() &&
City == _Maps[(int)_ActiveMap].GetCurrentCity())
{
return true;
}
return _Maps[(int)_ActiveMap].GetCurrentCountry();
}
return false;
public string GetCurrentCity()
{
return _Maps[(int)_ActiveMap].GetCurrentCity();
}

View File

@ -44,7 +44,73 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 5
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _IsGrabbed
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _IsGrabbed
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 3
- 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: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 2
- Name:
Entry: 7
Data: 5|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 6|UdonSharp.FieldChangeCallbackAttribute, 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:
@ -53,13 +119,13 @@ MonoBehaviour:
Data: _GameManager
- Name: $v
Entry: 7
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _GameManager
- Name: <UserType>k__BackingField
Entry: 7
Data: 3|System.RuntimeType, mscorlib
Data: 8|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: GameManagerRound3, Assembly-CSharp
@ -68,7 +134,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 4|System.RuntimeType, mscorlib
Data: 9|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.Udon.UdonBehaviour, VRC.Udon
@ -89,13 +155,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 10|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 6|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 11|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@ -111,6 +177,174 @@ MonoBehaviour:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _AudioManager
- Name: $v
Entry: 7
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _AudioManager
- Name: <UserType>k__BackingField
Entry: 7
Data: 13|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: AudioManager, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 9
- 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: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 15|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: _CollidingLocations
- Name: $v
Entry: 7
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CollidingLocations
- Name: <UserType>k__BackingField
Entry: 7
Data: 17|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDK3.Data.DataList, VRCSDK3
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 17
- 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: 18|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: _CollisionCheckCounter
- Name: $v
Entry: 7
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _CollisionCheckCounter
- Name: <UserType>k__BackingField
Entry: 7
Data: 20|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 20
- 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: 21|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

@ -1,94 +1,120 @@

using UdonSharp;
using UnityEngine;
using VRC.SDK3.Components;
using VRC.SDK3.Data;
using VRC.SDKBase;
using VRC.Udon;
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
public class FloorMapMarker : UdonSharpBehaviour
{
//[UdonSynced, FieldChangeCallback(nameof(Enabled))] public bool _Enabled = false;
//[UdonSynced, FieldChangeCallback(nameof(IsGrabbed))] public bool _IsGrabbed = false;
[UdonSynced, FieldChangeCallback(nameof(IsGrabbed))] private bool _IsGrabbed = false;
[SerializeField] private GameManagerRound3 _GameManager;
[SerializeField] private AudioManager _AudioManager;
//private DataList _OtherColliders = new DataList();
//private int _CollisionCheckCounter = 0;
//private const int MAX_COLLISION_CHECKS = 4;
private DataList _CollidingLocations = new DataList();
private int _CollisionCheckCounter = 0;
private const int MAX_REPEAT_COLLISION_CHECKS = 3;
private const float TIME_BETWEEN_REPEAT_COLLISION_CHECKS = 0.15f;
//public void OnTriggerEnter(Collider OtherCollider)
//{
// _OtherColliders.Add(OtherCollider);
// _CollisionCheckCounter = 0;
// if (!IsGrabbed) CheckCollisions();
//}
public void OnTriggerEnter(Collider OtherCollider)
{
FloorMapLocation Location = OtherCollider.GetComponent<FloorMapLocation>();
if (Location != null)
{
Debug.LogError("Found " + Location.City + ", " + Location.Country);
_CollidingLocations.Add(Location);
_CollisionCheckCounter = 0;
if (!IsGrabbed) CheckCollisions();
}
}
//public override void OnPickup()
//{
// IsGrabbed = true;
public override void OnPickup()
{
IsGrabbed = true;
_CollidingLocations.Clear();
// base.OnPickup();
//}
base.OnPickup();
}
//public override void OnDrop()
//{
// IsGrabbed = false;
// CheckCollisions();
public override void OnDrop()
{
IsGrabbed = false;
CheckCollisions();
// base.OnDrop();
//}
base.OnDrop();
}
//public void CheckCollisions()
//{
// if (IsUpright())
// {
// bool FoundCorrectResponse = false;
// for (int i = 0; i < _OtherColliders.Count; i++)
// {
// Collider OtherCollider = (Collider)_OtherColliders[i].Reference;
// if (OtherCollider != null)
// {
// FloorMapLocation Location = OtherCollider.GetComponent<FloorMapLocation>();
public void CheckCollisions()
{
if (_CollidingLocations.Count > 0 && IsUpright() && !IsGrabbed)
{
for (int i = 0; i < _CollidingLocations.Count; i++)
{
FloorMapLocation Location = (FloorMapLocation)_CollidingLocations[i].Reference;
if (Location != null)
{
bool FoundCorrectResponse = ConfirmChoice(Location.Country, Location.City);
if (FoundCorrectResponse)
{
_AudioManager.PlaySFX(SFXEventType.MapCorrect);
VRCPickup Pickup;
if (Pickup = GetComponent<VRCPickup>())
{
Pickup.pickupable = false;
}
// FoundCorrectResponse = _GameManager.ConfirmChoice(Location.Country, Location.City);
// if (FoundCorrectResponse) break;
// }
// }
transform.position = Location.transform.position;
// if (FoundCorrectResponse)
// {
// Debug.LogError("No error. We found the right place.");
// }
// else
// {
// _CollisionCheckCounter++;
// if (_CollisionCheckCounter < MAX_COLLISION_CHECKS)
// {
// SendCustomEventDelayedSeconds(nameof(CheckCollisions), 0.2f);
// }
// else
// {
// _OtherColliders.Clear();
// }
// }
// }
// else if (!IsGrabbed)
// {
// // If the marker isn't sitting mostly upright, or is grabbed,
// // don't check collisions until later, if it becomes upright.
// SendCustomEventDelayedSeconds(nameof(CheckCollisions), 0.2f);
// }
//}
return;
}
}
}
// We should make sure to only reach here if we don't get a correct
// response from the previous loop.
if (_CollisionCheckCounter < MAX_REPEAT_COLLISION_CHECKS)
{
SendCustomEventDelayedSeconds(nameof(CheckCollisions), TIME_BETWEEN_REPEAT_COLLISION_CHECKS);
}
else
{
_AudioManager.PlaySFX(SFXEventType.MapIncorrect);
_CollisionCheckCounter = 0;
transform.eulerAngles = new Vector3(-90.0f, 0.0f, 0.0f);
_CollidingLocations.Clear();
}
_CollisionCheckCounter++;
}
else
{
// If the marker isn't sitting mostly upright and is not grabbed,
// don't check collisions until later, in case it becomes upright.
SendCustomEventDelayedSeconds(nameof(CheckCollisions), TIME_BETWEEN_REPEAT_COLLISION_CHECKS);
}
}
//private bool IsUpright()
//{
// return (Vector3.Dot(transform.forward, Vector3.up) >= 0.85f);
//}
public bool ConfirmChoice(string Country, string City)
{
if (Country == _GameManager.GetCurrentCountry() &&
City == _GameManager.GetCurrentCity())
{
return true;
}
return false;
}
private bool IsUpright()
{
return (Vector3.Dot(transform.forward, Vector3.up) >= 0.85f);
}
//public bool Enabled
@ -100,12 +126,12 @@ public class FloorMapMarker : UdonSharpBehaviour
// get => _Enabled;
//}
//public bool IsGrabbed
//{
// set
// {
// _IsGrabbed = value;
// }
// get => _IsGrabbed;
//}
public bool IsGrabbed
{
set
{
_IsGrabbed = value;
}
get => _IsGrabbed;
}
}

View File

@ -10,8 +10,8 @@ AudioManager:
Default Speaker Mode: 2
m_SampleRate: 48000
m_DSPBufferSize: 1024
m_VirtualVoiceCount: 32
m_RealVoiceCount: 24
m_VirtualVoiceCount: 64
m_RealVoiceCount: 32
m_EnableOutputSuspension: 1
m_SpatializerPlugin: OculusSpatializer
m_AmbisonicDecoderPlugin: OculusSpatializer