浏览代码

A-Frame plugin: introduce the arfinished event

customisations
alemart 6 个月前
父节点
当前提交
be6ff96fc1
共有 2 个文件被更改,包括 12 次插入0 次删除
  1. 10
    0
      docs/api/plugin-aframe.md
  2. 2
    0
      plugins/aframe-with-encantar.js

+ 10
- 0
docs/api/plugin-aframe.md 查看文件

@@ -457,3 +457,13 @@ This event is emitted on the scene when the main loop of the AR scene is set up,
457 457
 **Details**
458 458
 
459 459
 * `ar: object`. A reference to the [ar](#ar) system.
460
+
461
+### arfinished
462
+
463
+The AR session has ended.
464
+
465
+*Since:* 0.4.2
466
+
467
+**Details**
468
+
469
+* `ar: object`. A reference to the [ar](#ar) system.

+ 2
- 0
plugins/aframe-with-encantar.js 查看文件

@@ -310,6 +310,8 @@ AFRAME.registerSystem('ar', Object.assign(ARBaseSystem(), {
310 310
             this.viewer = null;
311 311
             this.frame = null;
312 312
             this.pointers.length = 0;
313
+
314
+            scene.emit('arfinished', { ar: this });
313 315
         });
314 316
 
315 317
         session.viewport.addEventListener('resize', () => {

正在加载...
取消
保存