25 lines
No EOL
794 B
JavaScript
25 lines
No EOL
794 B
JavaScript
getEntityTextures = function(id) {
|
|
var results = null;
|
|
var properties = Entities.getEntityProperties(id, "textures");
|
|
//getEntityProperties desiredProperties param not working as described!
|
|
if (properties.textures) {
|
|
try {
|
|
results = JSON.parse(properties.textures);
|
|
} catch(err) {
|
|
logDebug(err);
|
|
logDebug(properties.textures);
|
|
}
|
|
}
|
|
return results ? results : {};
|
|
}
|
|
|
|
setEntityTextures = function(id, textureList) {
|
|
var json = JSON.stringify(textureList);
|
|
Entities.editEntity(id, { textures: json });
|
|
}
|
|
|
|
editEntityTextures = function(id, textureName, textureURL) {
|
|
var textureList = getEntityTextures(id);
|
|
textureList[textureName] = textureURL;
|
|
setEntityTextures(id, textureList);
|
|
} |