content/hifi-content/caitlyn/production/scriptsMisc/rezOnTouch.js
2022-02-13 22:19:19 +01:00

31 lines
No EOL
1.1 KiB
JavaScript

//
// Copyright 2016 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(){
// Script.include("../libraries/utils.js");
var REZ_POSITION = MyAvatar.position;//getJointPosition(MyAvatar.jointNames.indexOf("Flash")),
var IMPORT_URL = "http://mpassets.highfidelity.com/c3df96f0-1c66-42b7-82e3-e0a1ae490325-v1/bopoTheClown.svo.json";
var soundURL ='http://hifi-content.s3.amazonaws.com/caitlyn/production/lazybonesToybox/cameras/353044__montclairguy__camera-sound.wav';
var ringSound;
this.preload = function(entityID) {
print("preload("+entityID+")");
ringSound = SoundCache.getSound(soundURL);
};
this.startNearGrab = function(entityID, mouseEvent) {
Audio.playSound(ringSound, {
position: REZ_POSITION,
volume: 0.5
});
Script.setTimeout(function(){},2555);
Clipboard.importEntities(IMPORT_URL);
Clipboard.pasteEntities(REZ_POSITION);
};
})