From 68af62e333c7f4e590bbd0d3f8c7e663379902be Mon Sep 17 00:00:00 2001 From: Jamie Greunbaum Date: Thu, 21 May 2026 18:28:33 -0400 Subject: [PATCH] Risk card holder now has proper functionality. --- Assets/Prefabs/Player Podium.prefab | 9 +- Assets/Prefabs/Risk Card.prefab | 22 ++ Assets/UdonSharp/Podiums/RiskCard.cs | 6 +- Assets/UdonSharp/Podiums/RiskCardGroup.asset | 320 +++++++++++-------- Assets/UdonSharp/Podiums/RiskCardGroup.cs | 4 + 5 files changed, 224 insertions(+), 137 deletions(-) diff --git a/Assets/Prefabs/Player Podium.prefab b/Assets/Prefabs/Player Podium.prefab index 710317c..af58b5f 100644 --- a/Assets/Prefabs/Player Podium.prefab +++ b/Assets/Prefabs/Player Podium.prefab @@ -167,7 +167,6 @@ Transform: - {fileID: 78434554900276400} - {fileID: 6190117174038594721} - {fileID: 2250248657447934369} - - {fileID: 9149069322342715399} m_Father: {fileID: 5617792120913924276} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1273041045561394985 @@ -818,7 +817,7 @@ GameObject: - component: {fileID: 2039829568681020909} - component: {fileID: 6501792587173908481} - component: {fileID: 8906657908162858697} - m_Layer: 18 + m_Layer: 0 m_Name: Risk Card Holder m_TagString: Untagged m_Icon: {fileID: 0} @@ -834,11 +833,11 @@ Transform: m_GameObject: {fileID: 5957486306513083280} serializedVersion: 2 m_LocalRotation: {x: -0, y: 1, z: -0, w: 0.0000002533197} - m_LocalPosition: {x: 0, y: 0.18700004, z: 0.1565} + m_LocalPosition: {x: 0.304, y: 0.20200002, z: 0.13449998} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 4642601734963104639} + m_Father: {fileID: 9043478063159764907} m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} --- !u!65 &2039829568681020909 BoxCollider: @@ -1056,6 +1055,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 5026551168682279117} + - {fileID: 9149069322342715399} m_Father: {fileID: 5984335492357139332} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &5882532645313673403 @@ -1082,6 +1082,7 @@ MonoBehaviour: _udonSharpBackingUdonBehaviour: {fileID: 1400312625613948465} _Podium: {fileID: 1226214083704227558} _RiskCardEnabler: {fileID: 3061322123105718237} + _RiskCardHolder: {fileID: 2039829568681020909} _RiskCards: - {fileID: 4094763893478862042} - {fileID: 9164200151256120385} diff --git a/Assets/Prefabs/Risk Card.prefab b/Assets/Prefabs/Risk Card.prefab index 9d152f8..0574629 100644 --- a/Assets/Prefabs/Risk Card.prefab +++ b/Assets/Prefabs/Risk Card.prefab @@ -144,6 +144,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 6795592262274334657} + - component: {fileID: 796892433711394755} - component: {fileID: 7468242728661699280} - component: {fileID: 6321434272132706052} m_Layer: 13 @@ -168,6 +169,27 @@ Transform: m_Children: [] m_Father: {fileID: 13206456227318534} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!135 &796892433711394755 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5848617875499127176} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.05 + m_Center: {x: 0, y: 0, z: 0} --- !u!114 &7468242728661699280 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/UdonSharp/Podiums/RiskCard.cs b/Assets/UdonSharp/Podiums/RiskCard.cs index f289ba5..0d5c484 100644 --- a/Assets/UdonSharp/Podiums/RiskCard.cs +++ b/Assets/UdonSharp/Podiums/RiskCard.cs @@ -34,7 +34,7 @@ public class RiskCard : UdonSharpBehaviour void OnTriggerEnter(Collider OtherCollider) { - if (OtherCollider == _Holder) + if (Networking.IsOwner(gameObject) && OtherCollider == _Holder) { _IsInHeldCollider = true; } @@ -42,7 +42,7 @@ public class RiskCard : UdonSharpBehaviour private void OnTriggerExit(Collider OtherCollider) { - if (OtherCollider == _Holder) + if (Networking.IsOwner(gameObject) && OtherCollider == _Holder) { _IsInHeldCollider = false; } @@ -76,7 +76,7 @@ public class RiskCard : UdonSharpBehaviour { if (_IsInHeldCollider) { - _AnchorMode = CardAnchorMode.AtSpawn; + _AnchorMode = CardAnchorMode.InRiskCardHolder; _SetPosition_Synced(); RequestSerialization(); diff --git a/Assets/UdonSharp/Podiums/RiskCardGroup.asset b/Assets/UdonSharp/Podiums/RiskCardGroup.asset index e1914b4..8a389ba 100644 --- a/Assets/UdonSharp/Podiums/RiskCardGroup.asset +++ b/Assets/UdonSharp/Podiums/RiskCardGroup.asset @@ -44,7 +44,7 @@ MonoBehaviour: Data: - Name: Entry: 12 - Data: 13 + Data: 14 - Name: Entry: 7 Data: @@ -176,31 +176,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _RiskCards + Data: _RiskCardHolder - Name: $v Entry: 7 Data: 11|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: _RiskCards + Data: _RiskCardHolder - Name: k__BackingField Entry: 7 Data: 12|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: RiskCard[], Assembly-CSharp + Data: UnityEngine.Collider, UnityEngine.PhysicsModule - Name: Entry: 8 Data: - Name: k__BackingField - Entry: 7 - Data: 13|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.Component[], UnityEngine.CoreModule - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 12 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -215,13 +209,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 13|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 15|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 14|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -242,25 +236,31 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _RiskCardText + Data: _RiskCards - Name: $v Entry: 7 - Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: _RiskCardText + Data: _RiskCards - Name: k__BackingField Entry: 7 - Data: 17|System.RuntimeType, mscorlib + Data: 16|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: TMPro.TextMeshProUGUI[], Unity.TextMeshPro + Data: RiskCard[], Assembly-CSharp - Name: Entry: 8 Data: - Name: k__BackingField - Entry: 9 - Data: 17 + Entry: 7 + Data: 17|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: UnityEngine.Component[], UnityEngine.CoreModule + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -302,19 +302,25 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _PCCardHeldPosition + Data: _RiskCardText - Name: $v Entry: 7 Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: _PCCardHeldPosition + Data: _RiskCardText - Name: k__BackingField - Entry: 9 - Data: 8 + Entry: 7 + Data: 21|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: TMPro.TextMeshProUGUI[], Unity.TextMeshPro + - Name: + Entry: 8 + Data: - Name: k__BackingField Entry: 9 - Data: 8 + Data: 21 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -329,13 +335,13 @@ MonoBehaviour: Data: true - Name: _fieldAttributes Entry: 7 - Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 22|UnityEngine.SerializeField, UnityEngine.CoreModule + Data: 23|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -356,25 +362,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _PCCardAnimator + Data: _PCCardHeldPosition - Name: $v Entry: 7 - Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: _PCCardAnimator + Data: _PCCardHeldPosition - Name: k__BackingField - Entry: 7 - Data: 24|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.Animator, UnityEngine.AnimationModule - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 8 - Name: k__BackingField Entry: 9 - Data: 24 + Data: 8 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -416,19 +416,19 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _Enabled + Data: _PCCardAnimator - Name: $v Entry: 7 Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 - Data: _Enabled + Data: _PCCardAnimator - Name: k__BackingField Entry: 7 Data: 28|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: System.Boolean, mscorlib + Data: UnityEngine.Animator, UnityEngine.AnimationModule - Name: Entry: 8 Data: @@ -439,14 +439,14 @@ MonoBehaviour: Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - Name: - Entry: 3 - Data: 1 + Entry: 6 + Data: - Name: Entry: 8 Data: - Name: k__BackingField Entry: 5 - Data: false + Data: true - Name: _fieldAttributes Entry: 7 Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib @@ -455,7 +455,7 @@ MonoBehaviour: Data: 1 - Name: Entry: 7 - Data: 30|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 30|UnityEngine.SerializeField, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -476,19 +476,79 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: _ChoiceTextVisibleForAllPlayers + Data: _Enabled - Name: $v Entry: 7 Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _Enabled + - Name: k__BackingField + Entry: 7 + Data: 32|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 32 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 33|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 34|UdonSharp.UdonSyncedAttribute, 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: + - Name: $k + Entry: 1 + Data: _ChoiceTextVisibleForAllPlayers + - Name: $v + Entry: 7 + Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _ChoiceTextVisibleForAllPlayers - Name: k__BackingField Entry: 9 - Data: 28 + Data: 32 - Name: k__BackingField Entry: 9 - Data: 28 + Data: 32 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -503,13 +563,13 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 36|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 33|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 37|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: @@ -533,16 +593,16 @@ MonoBehaviour: Data: _DisableInteractive - Name: $v Entry: 7 - Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _DisableInteractive - Name: k__BackingField Entry: 9 - Data: 28 + Data: 32 - Name: k__BackingField Entry: 9 - Data: 28 + Data: 32 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -557,13 +617,13 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 39|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 36|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 40|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: @@ -587,16 +647,16 @@ MonoBehaviour: Data: _SetPickupable - Name: $v Entry: 7 - Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 41|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _SetPickupable - Name: k__BackingField Entry: 9 - Data: 28 + Data: 32 - Name: k__BackingField Entry: 9 - Data: 28 + Data: 32 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -611,13 +671,13 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 39|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 43|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: @@ -641,16 +701,16 @@ MonoBehaviour: Data: _ChoiceLocked - Name: $v Entry: 7 - Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _ChoiceLocked - Name: k__BackingField Entry: 9 - Data: 28 + Data: 32 - Name: k__BackingField Entry: 9 - Data: 28 + Data: 32 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -665,13 +725,13 @@ MonoBehaviour: Data: false - Name: _fieldAttributes Entry: 7 - Data: 41|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 45|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 1 - Name: Entry: 7 - Data: 42|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + Data: 46|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime - Name: Entry: 8 Data: @@ -695,76 +755,16 @@ MonoBehaviour: Data: _TurnForward - Name: $v Entry: 7 - Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: k__BackingField Entry: 1 Data: _TurnForward - Name: k__BackingField Entry: 9 - Data: 28 + Data: 32 - Name: k__BackingField Entry: 9 - Data: 28 - - Name: k__BackingField - Entry: 7 - Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib - - Name: - Entry: 3 - Data: 1 - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 5 - Data: false - - Name: _fieldAttributes - Entry: 7 - Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - - Name: - Entry: 12 - Data: 1 - - Name: - Entry: 7 - Data: 45|UdonSharp.UdonSyncedAttribute, 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: - - Name: $k - Entry: 1 - Data: _SelectedRiskAmount - - Name: $v - Entry: 7 - Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - - Name: k__BackingField - Entry: 1 - Data: _SelectedRiskAmount - - Name: k__BackingField - Entry: 7 - Data: 47|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.Int32, mscorlib - - Name: - Entry: 8 - Data: - - Name: k__BackingField - Entry: 9 - Data: 47 + Data: 32 - Name: k__BackingField Entry: 7 Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib @@ -801,6 +801,66 @@ MonoBehaviour: - Name: Entry: 8 Data: + - Name: + Entry: 7 + Data: + - Name: $k + Entry: 1 + Data: _SelectedRiskAmount + - Name: $v + Entry: 7 + Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + - Name: k__BackingField + Entry: 1 + Data: _SelectedRiskAmount + - Name: k__BackingField + Entry: 7 + Data: 51|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Int32, mscorlib + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 9 + Data: 51 + - Name: k__BackingField + Entry: 7 + Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib + - Name: + Entry: 3 + Data: 1 + - Name: + Entry: 8 + Data: + - Name: k__BackingField + Entry: 5 + Data: false + - Name: _fieldAttributes + Entry: 7 + Data: 52|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + - Name: + Entry: 12 + Data: 1 + - Name: + Entry: 7 + Data: 53|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: + - Name: + Entry: 8 + Data: - Name: Entry: 13 Data: diff --git a/Assets/UdonSharp/Podiums/RiskCardGroup.cs b/Assets/UdonSharp/Podiums/RiskCardGroup.cs index 331ab33..b8ce09c 100644 --- a/Assets/UdonSharp/Podiums/RiskCardGroup.cs +++ b/Assets/UdonSharp/Podiums/RiskCardGroup.cs @@ -11,6 +11,7 @@ public class RiskCardGroup : UdonSharpBehaviour { [SerializeField] private PlayerPodium _Podium; [SerializeField] private GameObject _RiskCardEnabler; + [SerializeField] private Collider _RiskCardHolder; [SerializeField] private RiskCard[] _RiskCards; [SerializeField] private TextMeshProUGUI[] _RiskCardText; @@ -154,11 +155,14 @@ public class RiskCardGroup : UdonSharpBehaviour _InteractiveAndPickupable_Synced(); MakeRiskTextVisible(true, false); RequestSerialization(); + + _RiskCardHolder.gameObject.SetActive(true); } public void ResetCards(bool RequestSerialisation = true) { _SelectedRiskAmount = -1; + _RiskCardHolder.gameObject.SetActive(false); for (int i = 0; i < _RiskCards.Length; i++) {