From 5c6b226b6479c3a21d4246e9219638ba7fd84736 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Fri, 22 Aug 2025 08:58:06 +0200 Subject: [PATCH] Added warnings when attaching fails --- Runtime/Tools/Scripts/Socket.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Runtime/Tools/Scripts/Socket.cs b/Runtime/Tools/Scripts/Socket.cs index 22a2163..94bbd57 100644 --- a/Runtime/Tools/Scripts/Socket.cs +++ b/Runtime/Tools/Scripts/Socket.cs @@ -304,18 +304,19 @@ namespace Passer { if (handle == null) { // Transform does not have a handle - DebugLog(gameObject.name + ": Attach failed. Object " + transformToAttach.name + " does not have a handle"); + Debug.LogWarning(gameObject.name + ": Attach failed. Object " + transformToAttach.name + " does not have a handle"); return false; } if (handle.socket != null) { + Debug.LogWarning(gameObject.name + ": Attach failed. Object " + transformToAttach.name + " is already in a socket"); // Handle is already in a socket return false; } if (socketTag != null && socketTag != "" && !transformToAttach.gameObject.CompareTag(socketTag)) { // Object did not have the right tag - Debug.Log(gameObject.name + ": Attach failed. Object " + transformToAttach + " does not have the right tag"); ; + Debug.LogWarning(gameObject.name + ": Attach failed. Object " + transformToAttach + " does not have the right tag"); ; return false; } @@ -323,7 +324,7 @@ namespace Passer { if (handleRigidbody != rigidbodyToAttach) { // Object does not have a handle, // found handle is of child rigidbody - //Debug.Log(gameObject.name + ": Attach failed. Object does not have a handle. Handle is on child Rigidbody."); + Debug.LogWarning(gameObject.name + ": Attach failed. Object does not have a handle. Handle is on child Rigidbody."); return false; } @@ -342,7 +343,7 @@ namespace Passer { DebugLog(this.gameObject.name + " Attach handle " + handle); if (handle == null) { // Transform does not have a handle - DebugLog(gameObject.name + ": Attach failed. Transform does not have a handle"); + Debug.LogWarning(gameObject.name + ": Attach failed. Transform does not have a handle"); return false; } @@ -354,7 +355,7 @@ namespace Passer { if (socketTag != null && socketTag != "" && !handle.gameObject.CompareTag(socketTag)) { // Object did not have the right tag - Debug.Log(gameObject.name + ": Attach failed. Handle " + handle + " does not have the right tag"); ; + Debug.LogWarning(gameObject.name + ": Attach failed. Handle " + handle + " does not have the right tag"); ; return false; } @@ -420,7 +421,7 @@ namespace Passer { } protected void AttachTransformParenting(Transform objTransform, Handle handle) { - Debug.Log("AttachTransformParenting: " + objTransform); + DebugLog("AttachTransformParenting: " + objTransform); attachedTransformParent = objTransform.parent;