ソースを参照

A-Frame plugin: rename events to arready and arsessionended

customisations
alemart 6ヶ月前
コミット
0cd2f52f0a
2個のファイルの変更9行の追加9行の削除
  1. 6
    6
      docs/api/plugin-aframe.md
  2. 3
    3
      plugins/aframe-with-encantar.js

+ 6
- 6
docs/api/plugin-aframe.md ファイルの表示

@@ -450,7 +450,7 @@ A corresponding `THREE.Ray`.
450 450
 
451 451
 The events below are emitted on the scene.
452 452
 
453
-### arstarted
453
+### arready
454 454
 
455 455
 The main loop of the AR scene has been set up. This takes place just after the AR session starts.
456 456
 
@@ -458,9 +458,9 @@ The main loop of the AR scene has been set up. This takes place just after the A
458 458
 
459 459
 **Details**
460 460
 
461
-* `ar: object`. A reference to the [ar](#ar) system.
461
+* `ar: object`. The [ar](#ar) system.
462 462
 
463
-### arfinished
463
+### arsessionended
464 464
 
465 465
 The AR session has ended.
466 466
 
@@ -468,7 +468,7 @@ The AR session has ended.
468 468
 
469 469
 **Details**
470 470
 
471
-* `ar: object`. A reference to the [ar](#ar) system.
471
+* `ar: object`. The [ar](#ar) system.
472 472
 
473 473
 ### artargetfound
474 474
 
@@ -479,7 +479,7 @@ An image target has been found.
479 479
 **Details**
480 480
 
481 481
 * `referenceImage: ReferenceImage`. The [reference image](reference-image.md) that is linked to the target.
482
-* `ar: object`. A reference to the [ar](#ar) system.
482
+* `ar: object`. The [ar](#ar) system.
483 483
 
484 484
 ### artargetlost
485 485
 
@@ -490,4 +490,4 @@ An image target has been lost.
490 490
 **Details**
491 491
 
492 492
 * `referenceImage: ReferenceImage`. The [reference image](reference-image.md) that is linked to the target.
493
-* `ar: object`. A reference to the [ar](#ar) system.
493
+* `ar: object`. The [ar](#ar) system.

+ 3
- 3
plugins/aframe-with-encantar.js ファイルの表示

@@ -189,7 +189,7 @@ AFRAME.registerSystem('ar', Object.assign(ARBaseSystem(), {
189 189
         scene.setAttribute('renderer', { alpha: true });
190 190
 
191 191
         // pause the scene until we're ready
192
-        scene.addEventListener('arstarted', () => {
192
+        scene.addEventListener('arready', () => {
193 193
             scene.play();
194 194
         });
195 195
         scene.addEventListener('loaded', () => {
@@ -252,7 +252,7 @@ AFRAME.registerSystem('ar', Object.assign(ARBaseSystem(), {
252 252
 
253 253
             // we're done!
254 254
             const scene = this.el;
255
-            scene.emit('arstarted', { ar: this });
255
+            scene.emit('arready', { ar: this });
256 256
             scene.emit('ar-started', { ar: this }); // backwards compatibility with 0.3.0 - 0.4.1
257 257
             return session;
258 258
         })
@@ -311,7 +311,7 @@ AFRAME.registerSystem('ar', Object.assign(ARBaseSystem(), {
311 311
             this.frame = null;
312 312
             this.pointers.length = 0;
313 313
 
314
-            scene.emit('arfinished', { ar: this });
314
+            scene.emit('arsessionended', { ar: this });
315 315
         });
316 316
 
317 317
         session.viewport.addEventListener('resize', () => {

読み込み中…
キャンセル
保存