content/hifi-content/wadewatts/Animation Apps/swimming/animation app button swim.js
2022-02-14 02:04:11 +01:00

28 lines
925 B
JavaScript

//WW
var URL = 'https://hifi-content.s3.amazonaws.com/wadewatts/Animation%20Apps/swimming/swimming_136.fbx';
var CONFIG = {
text: 'Swim',
icon: "https://hifi-content.s3.amazonaws.com/wadewatts/Animation%20Apps/swimming/swim-icon-off.svg",
activeIcon: "https://hifi-content.s3.amazonaws.com/wadewatts/Animation%20Apps/swimming/swim-icon-on.svg"
};
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"),
button = tablet.addButton(CONFIG);
button.clicked.connect(function() {
this.a = !this.a;
button.editProperties({ isActive: this.a });
if (this.a)
MyAvatar.overrideAnimation(URL, 30, true, 0, 136);
else
MyAvatar.restoreAnimation();
});
Script.scriptEnding.connect(function() { tablet.removeButton(button); });