mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-09 09:12:50 +02:00
Adding hidden reset switch to room which, when grabbed or clicked on, will reset room
This commit is contained in:
parent
039d9a6a98
commit
3465e3cc13
3 changed files with 1155 additions and 1046 deletions
50
unpublishedScripts/hiddenEntityReset.js
Normal file
50
unpublishedScripts/hiddenEntityReset.js
Normal 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();
|
||||
})
|
8
unpublishedScripts/immediateClientReset.js
Normal file
8
unpublishedScripts/immediateClientReset.js
Normal 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
Loading…
Reference in a new issue