private static void WAnchorUpdate(ARUserAnchor anchor) { Logger.log(Logger.Type.Info, "WAnchorUpdate"); if (!tracking) { Logger.log(Logger.Type.Info, "tracking paused. Ignore."); return; } if (!anchors.Contains(anchor.identifier)) { Logger.log(Logger.Type.Warning, "=> WAnchorAdd (tracking was probably off and just turned on)."); WAnchorAdd(anchor); return; } if (WAnchorUpdated == null) { Logger.log(Logger.Type.Info, "no delegates for this event."); return; } Logger.log(Logger.Type.Info, "dispatch event."); WAnchor a = new WAnchor(anchor.identifier, UnityARMatrixOps.GetPose(anchor.transform)); WAnchorUpdated(a); }
private static void WAnchorAdd(ARUserAnchor anchor) { Logger.log(Logger.Type.Info, "WAnchorAdd"); if (!tracking) { Logger.log(Logger.Type.Info, "tracking paused. Ignore."); return; } if (!anchors.Add(anchor.identifier)) { Logger.log(Logger.Type.Warning, "anchor was already added: {0}", anchor.identifier); return; } if (WAnchorAdded == null) { Logger.log(Logger.Type.Info, "no delegates for this event."); return; } Logger.log(Logger.Type.Info, "dispatch event."); WAnchor a = new WAnchor(anchor.identifier, UnityARMatrixOps.GetPose(anchor.transform)); WAnchorAdded(a); }