SpatialEntity.Destroy
bool Destroy()
Removes an app-created entity like an anchor from the
system entirely. It’s unpersisted if persisted, the system stops
tracking it, and it leaves the entity list at the end of the
frame. This SpatialEntity stops resolving once that happens.
This also works on entities that are still Pending, including
ones from FindAnchor that haven’t loaded yet.
| RETURNS: bool | False if this entity can’t be destroyed! Only app-created entities like anchors can be, entities the system discovered on its own, like planes, cannot. |
Examples
Removing anchors
static void RemoveAnchors(SpatialEntity anchor, Guid savedGuid)
{
// Gone for good, from this session, storage, and its name
anchor.Destroy();
// Stays for this session, but won't come back next launch
anchor.Unpersist();
// Cleans up a Guid from an earlier session, without loading it
SpatialEntity.Unpersist(savedGuid);
}
Found an issue with these docs, or have some additional questions? Create an Issue on Github!