mirror of
https://github.com/lubosz/overte.git
synced 2025-04-16 09:29:16 +02:00
Merge pull request #8271 from thoys/fix-duplicate-teleport-target-overlays
FIX duplicate teleport target overlays
This commit is contained in:
commit
1dd7d108d8
1 changed files with 8 additions and 2 deletions
|
@ -88,10 +88,13 @@ function Teleporter() {
|
|||
|
||||
this.createTargetOverlay = function() {
|
||||
|
||||
if (_this.targetOverlay !== null) {
|
||||
return;
|
||||
}
|
||||
var targetOverlayProps = {
|
||||
url: TARGET_MODEL_URL,
|
||||
dimensions: TARGET_MODEL_DIMENSIONS,
|
||||
visible: true,
|
||||
visible: true
|
||||
};
|
||||
|
||||
_this.targetOverlay = Overlays.addOverlay("model", targetOverlayProps);
|
||||
|
@ -191,6 +194,9 @@ function Teleporter() {
|
|||
};
|
||||
|
||||
this.deleteTargetOverlay = function() {
|
||||
if (this.targetOverlay === null) {
|
||||
return;
|
||||
}
|
||||
Overlays.deleteOverlay(this.targetOverlay);
|
||||
this.intersection = null;
|
||||
this.targetOverlay = null;
|
||||
|
@ -616,4 +622,4 @@ function cleanup() {
|
|||
if (teleporter.updateConnected !== null) {
|
||||
Script.update.disconnect(teleporter.update);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue