Skip to content

Commit f165256

Browse files
committed
fix: probes can be deleted again
1 parent b12e47f commit f165256

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

API/oursin/probes.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,20 @@ def delete(self):
5353
"""
5454
client.sio.emit('urchin-probe-delete', IDData(id=self.data.id).to_json_string())
5555
self.in_unity = False
56+
57+
def __del__(self):
58+
"""Delete probe objects when object is deleted
59+
60+
Parameters
61+
----------
62+
references probe being deleted
63+
64+
Examples
65+
--------
66+
>>> del p1
67+
"""
68+
if self.in_unity:
69+
self.delete()
5670

5771
def set_color(self,color):
5872
"""Set colors of probe objects

UnityClient/Packages/vbl.urchin/Scripts/Managers/ProbeManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void Delete(IDData data)
117117
{
118118
if (_probes.ContainsKey(data.ID))
119119
{
120-
Destroy(_probes[data.ID]);
120+
Destroy(_probes[data.ID].gameObject);
121121
_probes.Remove(data.ID);
122122
}
123123
}

0 commit comments

Comments
 (0)