mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-23 07:34:20 +02:00
Add the mallet js file
This commit is contained in:
parent
1f6b92a519
commit
f1d7ef76e7
1 changed files with 25 additions and 0 deletions
25
unpublishedScripts/marketplace/xylophone/xylophoneMallet.js
Normal file
25
unpublishedScripts/marketplace/xylophone/xylophoneMallet.js
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
//
|
||||||
|
// xylophoneMallet.js
|
||||||
|
//
|
||||||
|
// Created by Johnathan Franck on 07/30/2017
|
||||||
|
// Copyright 2017 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() {
|
||||||
|
function XylophoneMallet() {
|
||||||
|
}
|
||||||
|
|
||||||
|
XylophoneMallet.prototype = {
|
||||||
|
startEquip: function(entityID, args) {
|
||||||
|
var LEFT_HAND = 0;
|
||||||
|
var RIGHT_HAND = 1;
|
||||||
|
var userData = JSON.parse(Entities.getEntityProperties(entityID, 'userData').userData);
|
||||||
|
userData.hand = args[0] === "left" ? LEFT_HAND : RIGHT_HAND;
|
||||||
|
Entities.editEntity(entityID, {userData: JSON.stringify(userData)});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return new XylophoneMallet();
|
||||||
|
});
|
Loading…
Reference in a new issue