|
@@ -79,7 +79,9 @@ export default class Player {
|
|
|
let pos = new THREE.Vector3(0, 0, -1);
|
|
|
pos.unproject(this.orthCamera);
|
|
|
pos.y = 5;
|
|
|
- this.symbolIndex += 1;
|
|
|
+ const lastIndex = this.getLaSybIndex();
|
|
|
+ this.symbolIndex = lastIndex + 1;
|
|
|
+
|
|
|
this.symbol = new CircleTextLabel(this.symbolIndex, pos);
|
|
|
this.symbol.visible = false;
|
|
|
this.scene.scene.add(this.symbol);
|
|
@@ -103,6 +105,15 @@ export default class Player {
|
|
|
}
|
|
|
this.scene.emit("mode", this.mode);
|
|
|
}
|
|
|
+ getLaSybIndex() {
|
|
|
+ const maxIndexObject = this.renderSymbols.reduce(
|
|
|
+ (max, current) => {
|
|
|
+ return current.index > max.index ? current : max;
|
|
|
+ },
|
|
|
+ { index: 0, point: [] }
|
|
|
+ );
|
|
|
+ return maxIndexObject.index;
|
|
|
+ }
|
|
|
|
|
|
// removeMarker() {
|
|
|
// if (this.marker) {
|
|
@@ -339,7 +350,7 @@ export default class Player {
|
|
|
);
|
|
|
lasPos.unproject(this.orthCamera);
|
|
|
lasPos.y = 5;
|
|
|
-
|
|
|
+
|
|
|
const activeSymbolItem = {
|
|
|
index: this.symbolIndex,
|
|
|
point: lasPos.toArray(),
|