You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Runtime/Components/Helpers/AttachableBehaviour.cs
+8-10Lines changed: 8 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -499,18 +499,16 @@ public void Detach()
499
499
if(!m_AttachableNode)
500
500
{
501
501
NetworkLog.LogError($"[{name}][Detach] Invalid state detected! {name}'s state is still {m_AttachState} but has no {nameof(AttachableNode)} assigned!");
502
+
// Developer only notification for the most likely scenario where this method is invoked but the instance is not attached to anything.
NetworkLog.LogWarning($"[{name}][Detach] Cannot detach! {name} is not attached to anything!");
508
-
}
509
-
510
-
// If we have the attachable node set and we are not in the middle of detaching, then log an error and note
511
-
// this could potentially occur if inoked more than once for the same instance in the same frame.
512
-
if(m_AttachableNode)
508
+
else
513
509
{
510
+
// If we have the attachable node set and we are not in the middle of detaching, then log an error and note
511
+
// this could potentially occur if inoked more than once for the same instance in the same frame.
514
512
NetworkLog.LogError($"[{name}][Detach] Invalid state detected! {name} is still referencing {nameof(AttachableNode)}{m_AttachableNode.name}! Could {nameof(Detach)} be getting invoked more than once for the same instance?");
0 commit comments