content/hifi-content/milad/Domains/Rust_Scripts/Model-Image/Model-Image.js
2022-02-14 02:04:11 +01:00

24 lines
No EOL
692 B
JavaScript

(function(){
var avatarUrl;
this.preload = function(id){
var entProps = Entities.getEntityProperties(id);
var userData = entProps.userData;
avatarUrl = JSON.parse(userData).avatarUrl;
print("avatarURL: ", avatarUrl);
}
this.replaceAvatar = function() {
MyAvatar.useFullAvatarURL(avatarUrl);
};
this.replaceAvatarByMouse = function(entityID, mouseEvent) {
if (mouseEvent.isLeftButton) {
this.replaceAvatar();
}
};
this.clickDownOnEntity = this.replaceAvatarByMouse;
this.startFarTrigger = this.replaceAvatar;
this.startNearTrigger = this.replaceAvatar;
})