content/hifi-content/faye/vrhackathonsf/potionBottleEntityScript.js
2022-02-13 23:26:00 +01:00

40 lines
No EOL
886 B
JavaScript

//
// potionBottleEntityScript.js
//
// Created by Faye Li on December 3, 2016
//
(function() {
function showDrinkingFx () {
print("show drinking fx");
//TODO: Particle fx
//TODO: Audio fx
}
function enableGestureRecognizer () {
print("enable Gesture Recognizer");
Settings.setValue("hackathon-spell-enabled", true);
}
this.preload = function(entityID) {
Settings.setValue("hackathon-spell-enabled", false);
};
this.startNearGrab = function(entityId) {
showDrinkingFx();
enableGestureRecogniser();
};
this.clickReleaseOnEntity = function(entityID, mouseEvent) {
if (!mouseEvent.isLeftButton) {
return;
}
showDrinkingFx();
enableGestureRecognizer();
};
this.unload = function(entityID) {
Settings.setValue("hackathon-spell-enabled", false);
};
});