content/hifi-content/elisa/production/rust-pills/scripts/discoPillClient.js
2022-02-13 23:16:46 +01:00

33 lines
No EOL
799 B
JavaScript

//
// discoPillClient.js
// Enables pill drop when disco ball is triggered
//
// Author: Elisa Lupin-Jimenez
// Copyright High Fidelity 2018
//
// Licensed under the Apache 2.0 License
// See accompanying license file or http://apache.org/
//
// All assets are under CC Attribution Non-Commerical
// http://creativecommons.org/licenses/
//
(function() {
var _entityID;
this.preload = function(entityID) {
_entityID = entityID;
};
this.mousePressOnEntity = function(entityID, mouseEvent) {
if (mouseEvent.isLeftButton) {
Entities.callEntityServerMethod(entityID, "dropPills");
}
};
this.startFarTrigger = function() {
Entities.callEntityServerMethod(_entityID, "dropPills");
};
});