28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
|
|
//<div>Icons made by <a href="http://www.flaticon.com/authors/dave-gandy" title="Dave Gandy">Dave Gandy</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>
|
|
var URL = 'https://s3-us-west-2.amazonaws.com/highfidelityvr/house_dancing.fbx';
|
|
var CONFIG = {
|
|
text: 'LIFE',
|
|
icon: "https://s3.amazonaws.com/greeterscripts/Scripts/white-one.svg",
|
|
activeIcon: "https://s3.amazonaws.com/greeterscripts/Scripts/black-one.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, 84);
|
|
|
|
|
|
else
|
|
MyAvatar.restoreAnimation();
|
|
|
|
});
|
|
|
|
|
|
Script.scriptEnding.connect(function() { tablet.removeButton(button); });
|