This commit is contained in:
James B. Pollack 2016-03-24 09:15:27 -07:00
parent d8b728f30f
commit 106c140bd4
2 changed files with 33 additions and 13 deletions

View file

@ -1,25 +1,51 @@
(function() { (function() {
var utilsPath = Script.resolvePath("../utils.js");
Script.include(utilsPath);
DressingRoom = function() { DressingRoom = function() {
return this return this
} }
DressingRoom.prototype = { DressingRoom.prototype = {
preload: function(entityID) { preload: function(entityID) {
print('PRELOAD DRESSING ROOM') print('PRELOAD DRESSING ROOM');
this.entityID = entityID; this.entityID = entityID;
}, },
enterEntity: function() { enterEntity: function() {
print('ENTER DRESSING ROOM') print('ENTER DRESSING ROOM');
makeDoppelgangerForMyAvatar(); makeDoppelgangerForMyAvatar();
subscribeToWearableMessages(); subscribeToWearableMessages();
subscribeToFreezeMessages(); subscribeToFreezeMessages();
this.setOccupied();
}, },
leaveEntity: function() { leaveEntity: function() {
print('EXIT DRESSING ROOM!') print('EXIT DRESSING ROOM!');
this.setUnoccupied();
cleanup(); cleanup();
} },
checkIfOccupied: function() {
var data = getEntityCustomData('hifi-home-dressing-room', this.entityID, {
occupied: false
});
return data.occupied;
},
setOccupied: function() {
setEntityCustomData('hifi-home-dressing-room', this.entityID, {
occupied: true
});
},
setUnoccupied: function() {
setEntityCustomData('hifi-home-dressing-room', this.entityID, {
occupied: false
});
},
unload: function() {
this.setUnoccupied();
this.cleanup();
},
}; };
// //
// doppelganger.js // doppelganger.js
// //
@ -31,7 +57,6 @@
// Distributed under the Apache License, Version 2.0. // Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
// To-Do: mirror joints, rotate avatar fully, automatically get avatar fbx, make sure dimensions for avatar are right when u bring it in
var TEST_MODEL_URL = 'https://s3.amazonaws.com/hifi-public/ozan/avatars/albert/albert/albert.fbx'; var TEST_MODEL_URL = 'https://s3.amazonaws.com/hifi-public/ozan/avatars/albert/albert/albert.fbx';
@ -437,9 +462,9 @@
} }
function disconnectDoppelgangerUpdates() { function disconnectDoppelgangerUpdates() {
if (isConnected === true) { if (isConnected === true) {
print('SHOULD DISCONNECT') print('SHOULD DISCONNECT')
Script.update.disconnect(updateDoppelganger); Script.update.disconnect(updateDoppelganger);
} }
isConnected = false; isConnected = false;

View file

@ -121,12 +121,7 @@ FishTank = function(spawnPosition, spawnRotation) {
color: DEBUG_COLOR, color: DEBUG_COLOR,
collisionless: true, collisionless: true,
script: TANK_SCRIPT, script: TANK_SCRIPT,
visible: true, visible: true
// userData: JSON.stringify({
// 'hifiHomeKey': {
// 'reset': true
// }
// }),
} }
fishTank = Entities.addEntity(tankProperties); fishTank = Entities.addEntity(tankProperties);