content/hifi-content/caitlyn/production/scriptsMisc/camera flash rezzer on touch.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 bellPosition = MyAvatar.getJointPosition(MyAvatar.jointNames.indexOf("Flash")),
var IMPORT_URL = "http://hifi-content.s3.amazonaws.com/caitlyn/production/lazybonesToybox/cameras/cameraFlash2.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: bellPosition,
volume: 0.5
});
Script.setTimeout(function(){},2555);
Clipboard.importEntities(IMPORT_URL);
Clipboard.pasteEntities(bellPosition);
};
})