瀏覽代碼

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
 **Details**
457
 **Details**
458
 
458
 
459
 * `ar: object`. A reference to the [ar](#ar) system.
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
             this.viewer = null;
310
             this.viewer = null;
311
             this.frame = null;
311
             this.frame = null;
312
             this.pointers.length = 0;
312
             this.pointers.length = 0;
313
+
314
+            scene.emit('arfinished', { ar: this });
313
         });
315
         });
314
 
316
 
315
         session.viewport.addEventListener('resize', () => {
317
         session.viewport.addEventListener('resize', () => {

Loading…
取消
儲存