38 lines
No EOL
1.3 KiB
JavaScript
38 lines
No EOL
1.3 KiB
JavaScript
"use strict";
|
|
|
|
(function () { // BEGIN LOCAL_SCOPE
|
|
var _this = this;
|
|
var blocksChannel = "blocks-channel";
|
|
var blockName;
|
|
var origColor;
|
|
|
|
_this.preload = function(entityID) {
|
|
_this.entityID = entityID;
|
|
blockName = Entities.getEntityProperties(_this.entityID, ["name"]).name;
|
|
origColor = Entities.getEntityProperties(_this.entityID, ["color"]).color;
|
|
if(JSON.stringify(origColor) === JSON.stringify({ red: 255, green: 255, blue: 255})) {
|
|
Entities.editEntity(_this.entityID, { color: {red: 247, green: 45, blue: 78} });
|
|
origColor = Entities.getEntityProperties(_this.entityID, ["color"]).color;
|
|
}
|
|
}
|
|
|
|
//_this.hoverEnterEntity = function(entityID, data) {
|
|
_this.turnWhite = function(entityID, data) {
|
|
Entities.editEntity(_this.entityID, { color: { red: 255, green: 255, blue: 255} });
|
|
};
|
|
|
|
//_this.startNearTrigger = function(entityID, data) {
|
|
//_this.clickDownOnEntity = function(entityID, data) {
|
|
_this.startDistanceGrab = function(entityID, data) {
|
|
Messages.sendMessage(blocksChannel, blockName);
|
|
};
|
|
|
|
//_this.hoverLeaveEntity = function(entityID, data) {
|
|
_this.turnRed = function(entityID, data) {
|
|
Entities.editEntity(_this.entityID, { color: origColor });
|
|
};
|
|
|
|
_this.unload = function(entityID) {
|
|
|
|
}
|
|
}) |