Przeglądaj źródła

A-Frame plugin: introduce the arfinished event

customisations
alemart 6 miesięcy temu
rodzic
commit
be6ff96fc1
2 zmienionych plików z 12 dodań i 0 usunięć
  1. 10
    0
      docs/api/plugin-aframe.md
  2. 2
    0
      plugins/aframe-with-encantar.js

+ 10
- 0
docs/api/plugin-aframe.md Wyświetl plik

@@ -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 Wyświetl plik

@@ -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', () => {

Ładowanie…
Anuluj
Zapisz