39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
// EntityJSONResetter.js
|
|
//
|
|
// Script Type: Entity
|
|
// Created by Eric Levin on 1/20/16.
|
|
// Copyright 2016 High Fidelity, Inc.
|
|
//
|
|
// This entity script resets the EntityJSON when triggered
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
(function() {
|
|
Script.include("../libraries/utils.js");
|
|
var _this;
|
|
var pinProperties = null;
|
|
var IMPORT_URL = "http://hifi-content.s3.amazonaws.com/caitlyn/production/bowlingAlley/bowlingPins.svo.json";
|
|
var PASTE_ENTITIES_LOCATION = MyAvatar.position;
|
|
var EntityJSONResetter = function() {
|
|
_this = this;
|
|
};
|
|
EntityJSONResetter.prototype = {
|
|
clickReleaseOnEntity: function(entityId, mouseEvent) {
|
|
if (!mouseEvent.isLeftButton) {
|
|
return;
|
|
}
|
|
this.importAssetResourceFile();
|
|
},
|
|
|
|
importAssetResourceFile: function() {
|
|
Clipboard.importEntities(IMPORT_URL);
|
|
Clipboard.pasteEntities(PASTE_ENTITIES_LOCATION);
|
|
},
|
|
|
|
preload: function(entityID) {
|
|
this.entityID = entityID;
|
|
},
|
|
};
|
|
return new EntityJSONResetter();
|
|
});
|