mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 08:37:19 +02:00
Add files via upload
This commit is contained in:
parent
62287a6a9f
commit
0d11be9488
1 changed files with 24 additions and 0 deletions
24
pUtils.js
Normal file
24
pUtils.js
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
getEntityTextures = function(id) {
|
||||||
|
var results = null;
|
||||||
|
var properties = Entities.getEntityProperties(id, "textures");
|
||||||
|
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);
|
||||||
|
}
|
Loading…
Reference in a new issue