Adding hidden reset switch to room which, when grabbed or clicked on, will reset room

This commit is contained in:
ericrius1 2015-10-07 15:21:24 -07:00
parent 039d9a6a98
commit 3465e3cc13
3 changed files with 1155 additions and 1046 deletions

View file

@ -0,0 +1,50 @@
//
// ResetSwitch.js
//
// Created by Eric Levin on 10/2/15.
// Copyright 2015 High Fidelity, Inc.
//
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
(function () {
var _this;
var masterResetScript = Script.resolvePath("masterReset.js");
Script.include(masterResetScript);
ResetSwitch = function () {
_this = this;
};
ResetSwitch.prototype = {
clickReleaseOnEntity: function (entityId, mouseEvent) {
if (!mouseEvent.isLeftButton) {
return;
}
this.triggerReset();
},
startNearGrabNonColliding: function () {
this.triggerReset();
},
triggerReset: function () {
MasterReset();
},
preload: function (entityID) {
this.entityID = entityID;
}
};
// entity scripts always need to return a newly constructed object of our type
return new ResetSwitch();
})

View file

@ -0,0 +1,8 @@
/*global print, MyAvatar, Entities, AnimationCache, SoundCache, Scene, Camera, Overlays, Audio, HMD, AvatarList, AvatarManager, Controller, UndoStack, Window, Account, GlobalServices, Script, ScriptDiscoveryService, LODManager, Menu, Vec3, Quat, AudioDevice, Paths, Clipboard, Settings, XMLHttpRequest, pointInExtents, vec3equal, setEntityCustomData, getEntityCustomData */
/*global MasterReset */
var masterResetScript = Script.resolvePath("masterReset.js");
Script.include(masterResetScript);
MasterReset();

File diff suppressed because it is too large Load diff