From 71b7a3b919b40c929ceb2afd1a81b90e27f7dfb9 Mon Sep 17 00:00:00 2001 From: Mark Joshwel Date: Fri, 14 Feb 2025 22:18:17 +0800 Subject: [PATCH] game(scripts): standardise DrawerDynamicJointConfiguration --- .../DrawerDynamicJointConfiguration.cs | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Game/Assets/Scripts/DrawerDynamicJointConfiguration.cs b/Game/Assets/Scripts/DrawerDynamicJointConfiguration.cs index 0ffccfd..3a3e9b0 100644 --- a/Game/Assets/Scripts/DrawerDynamicJointConfiguration.cs +++ b/Game/Assets/Scripts/DrawerDynamicJointConfiguration.cs @@ -1,3 +1,9 @@ +/* + * Author: Mark + * Date: 31/1/2025 + * Description: Dynamic configuration script for a drawer interactable + */ + using System; using UnityEngine; using UnityEngine.XR.Interaction.Toolkit.Interactables; @@ -8,14 +14,16 @@ public class DrawerDynamicJointConfiguration : MonoBehaviour { [Header("mark's all-in-one dynamic drawer component")] [Space(10)] - [HelpBox("make sure every child inside both prefabs are under the" + - "'Interactable Environment' layer.\n\n" + - "whatever non-standard (a la ProBuilder) object geometry under the " + - "interactable prefab should have a convex mesh collider if the console nags about it!\n\n" + - "any Curve Interaction Casters (a la 'XR Origin (VR)' > 'Camera Offset' > '... Controller' " + - "> 'Near-Far Interactor' > 'Curve Interaction Caster') should be have the " + - "'Interactable Environment' layer included in its' Raycast Mask.", - HelpBoxMessageType.Error)] + #if UNITY_EDITOR + [HelpBox("make sure every child inside both prefabs are under the" + + "'Interactable Environment' layer.\n\n" + + "whatever non-standard (a la ProBuilder) object geometry under the " + + "interactable prefab should have a convex mesh collider if the console nags about it!\n\n" + + "any Curve Interaction Casters (a la 'XR Origin (VR)' > 'Camera Offset' > '... Controller' " + + "> 'Near-Far Interactor' > 'Curve Interaction Caster') should be have the " + + "'Interactable Environment' layer included in its' Raycast Mask.", + HelpBoxMessageType.Error)] + #endif [Space(10)] [SerializeField] private MovementAxis movementAxis = MovementAxis.Z; @@ -61,7 +69,7 @@ public class DrawerDynamicJointConfiguration : MonoBehaviour bounciness = 0, contactDistance = 0 }; - + // configure the rigidbody var rb = GetComponent(); rb.isKinematic = false;