mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-09 09:02:29 +02:00
only disconnect mouse if connected
This commit is contained in:
parent
51b335c902
commit
663dadd1b4
5 changed files with 20 additions and 18 deletions
|
@ -13,18 +13,18 @@
|
|||
//
|
||||
|
||||
var IMPORT_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/arfs/junkyard.json";
|
||||
var PASTE_ENTITIES_LOCATION = {x: 0, y: 0, z: 0};
|
||||
reset();
|
||||
|
||||
function reset() {
|
||||
// Delete everything and re-import the junkyard arf
|
||||
var e = Entities.findEntities(MyAvatar.position, 1000);
|
||||
for (i = 0; i < e.length; i++) {
|
||||
Entities.deleteEntity(e[i]);
|
||||
}
|
||||
importAssetResourceFile();
|
||||
}
|
||||
var PASTE_ENTITIES_LOCATION = {x: 0, y: 20, z: 0};
|
||||
// reset();
|
||||
|
||||
// function reset() {
|
||||
// // Delete everything and re-import the junkyard arf
|
||||
// var e = Entities.findEntities(MyAvatar.position, 1000);
|
||||
// for (i = 0; i < e.length; i++) {
|
||||
// Entities.deleteEntity(e[i]);
|
||||
// }
|
||||
// importAssetResourceFile();
|
||||
// }
|
||||
importAssetResourceFile()
|
||||
function importAssetResourceFile() {
|
||||
Clipboard.importEntities(IMPORT_URL);
|
||||
Clipboard.pasteEntities(PASTE_ENTITIES_LOCATION);
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
this.buttonImageURL = baseURL + "GUI/GUI_jump_off.png";
|
||||
this.addExitButton();
|
||||
this.isRiding = false;
|
||||
|
||||
self.mouseIsConnected = false;
|
||||
if (this.data && this.data.isDynein) {
|
||||
this.rotation = 180;
|
||||
} else {
|
||||
|
@ -66,6 +66,7 @@
|
|||
visible: true
|
||||
});
|
||||
Controller.mousePressEvent.connect(this.onMousePress);
|
||||
self.mouseIsConnected = true;
|
||||
Script.update.connect(this.update);
|
||||
}
|
||||
}
|
||||
|
@ -136,8 +137,9 @@
|
|||
// print("unload");
|
||||
self.reset();
|
||||
|
||||
Controller.mousePressEvent.disconnect(this.onMousePress);
|
||||
if (self.mouseIsConnected === true) {
|
||||
Controller.mousePressEvent.disconnect(this.onMousePress);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
(function() {
|
||||
|
||||
var version = 1;
|
||||
var version = 2;
|
||||
var added = false;
|
||||
this.frame = 0;
|
||||
var utilsScript = Script.resolvePath('utils.js');
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
(function() {
|
||||
var self = this;
|
||||
var baseURL = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
|
||||
var version = 9;
|
||||
var version = 10;
|
||||
this.preload = function(entityId) {
|
||||
self.soundPlaying = false;
|
||||
self.entityId = entityId;
|
||||
self.getUserData();
|
||||
self.soundURL = baseURL + "Audio/" + self.userData.name + ".wav?" + version;
|
||||
print("Script.clearTimeout creating WAV name location is " + baseURL + "Audio/" + self.userData.name + ".wav");
|
||||
print("creating WAV name location is " + baseURL + "Audio/" + self.userData.name + ".wav");
|
||||
|
||||
self.soundOptions = {
|
||||
stereo: true,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
var version = 1004;
|
||||
var version = 1005;
|
||||
var cellLayout;
|
||||
var baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
|
||||
|
||||
|
|
Loading…
Reference in a new issue