Formatting corrections.

This commit is contained in:
Patterntrick 2017-04-30 14:06:36 -07:00
parent 29231f1ad1
commit 3b06057ce4

View file

@ -1,34 +1,34 @@
// //
// pUtils.js // pUtils.js
// //
// Created by Patrick Gosch on 03/28/2017 // Created by Patrick Gosch on 03/28/2017
// Copyright 2017 High Fidelity, Inc. // Copyright 2017 High Fidelity, Inc.
// //
// Distributed under the Apache License, Version 2.0. // Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
getEntityTextures = function(id) { getEntityTextures = function(id) {
var results = null; var results = null;
var properties = Entities.getEntityProperties(id, "textures"); var properties = Entities.getEntityProperties(id, "textures");
if (properties.textures) { if (properties.textures) {
try { try {
results = JSON.parse(properties.textures); results = JSON.parse(properties.textures);
} catch(err) { } catch (err) {
logDebug(err); logDebug(err);
logDebug(properties.textures); logDebug(properties.textures);
} }
} }
return results ? results : {}; return results ? results : {};
}; };
setEntityTextures = function(id, textureList) { setEntityTextures = function(id, textureList) {
var json = JSON.stringify(textureList); var json = JSON.stringify(textureList);
Entities.editEntity(id, {textures: json}); Entities.editEntity(id, {textures: json});
}; };
editEntityTextures = function(id, textureName, textureURL) { editEntityTextures = function(id, textureName, textureURL) {
var textureList = getEntityTextures(id); var textureList = getEntityTextures(id);
textureList[textureName] = textureURL; textureList[textureName] = textureURL;
setEntityTextures(id, textureList); setEntityTextures(id, textureList);
}; };