summaryrefslogtreecommitdiff
path: root/public/js/components/player-info.js
blob: 6110756c8366f1e2ff23d612851ce030452eb3b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* global AFRAME */
// Who someone is. Lives on each person's rig and is synced by Networked-A-Frame,
// so remote copies fire 'player-info-changed' whenever the owner updates it.
AFRAME.registerComponent('player-info', {
  schema: {
    name: { default: '' },
    color: { type: 'color', default: '#ffb36b' },
    avatar: { default: '' },
    muted: { default: false },
    seat: { type: 'int', default: -1 }, // index into the campsite's seats, or -1 standing
  },

  update() {
    this.el.emit('player-info-changed', this.data, false);
  },
});