diff --git a/Unity/Thing.cs b/Unity/Thing.cs index 457f893..9aed081 100644 --- a/Unity/Thing.cs +++ b/Unity/Thing.cs @@ -66,7 +66,7 @@ namespace RoboidControl.Unity { /// protected virtual void Update() { if (core == null) { - Debug.Log("Core thing is gone, self destruct in 0 seconds..."); + // Debug.Log("Core thing is gone, self destruct in 0 seconds..."); Destroy(this); return; } @@ -95,7 +95,7 @@ namespace RoboidControl.Unity { core.nameChanged = false; } if (core.hierarchyChanged) { - Debug.Log("Parent changed"); + // Debug.Log("Parent changed"); if (core.parent == null) this.transform.SetParent(null, true); else diff --git a/Unity/TouchSensor.cs b/Unity/TouchSensor.cs index 9814bee..c34d86d 100644 --- a/Unity/TouchSensor.cs +++ b/Unity/TouchSensor.cs @@ -42,7 +42,7 @@ namespace RoboidControl.Unity { rb.isKinematic = true; SphereCollider collider = gameObj.AddComponent(); - collider.radius = 0.01f; + collider.radius = 0.02f; collider.isTrigger = true; if (gameObj.transform.parent != null && gameObj.transform.localPosition.magnitude > 0) { @@ -54,10 +54,15 @@ namespace RoboidControl.Unity { } private void OnTriggerEnter(Collider other) { - if (other.isTrigger) + Debug.Log("Touch?"); + if (other.isTrigger) { + Debug.Log($" was trigger {other.name}"); return; - if (this.transform.root == other.transform.root) + } + if (this.transform.root == other.transform.root) { + Debug.Log($" was myself {other.name}"); return; + } Debug.Log($"*** {this} Touch"); this.coreSensor.touchedSomething = true; diff --git a/src/Participants/SiteServer.cs b/src/Participants/SiteServer.cs index 9e36f7c..4bd1c61 100644 --- a/src/Participants/SiteServer.cs +++ b/src/Participants/SiteServer.cs @@ -46,7 +46,9 @@ namespace RoboidControl { if (this.isIsolated == false) { // Send to all other participants - foreach (Participant participant in Participant.participants) { + //foreach (Participant participant in Participant.participants) { + for (int participantIx = 0; participantIx < Participant.participants.Count; participantIx++) { + Participant participant = Participant.participants[participantIx]; if (participant == null || participant == this) continue; @@ -85,7 +87,7 @@ namespace RoboidControl { Console.WriteLine($"Could not find parent [{msg.networkId}/{msg.parentId}]"); } else { - Console.Write($"Dropped {thing.id}"); + // Console.Write($"Dropped {thing.id}"); thing.parent = null; } } diff --git a/src/Thing.cs b/src/Thing.cs index 7e4ae16..b6d145a 100644 --- a/src/Thing.cs +++ b/src/Thing.cs @@ -90,7 +90,7 @@ namespace RoboidControl { this.id = thingId; this.type = thingType; this.networkId = networkId; - Console.Write($"New thing added to {owner}"); + // Console.Write($"New thing added to {owner}"); this.owner.Add(this); InvokeNewThing(this); }