content/hifi-content/ryan/development/PlanetDropBundle_v2/scripts/entity/default.js
2022-02-14 02:04:11 +01:00

44 lines
No EOL
1,018 B
JavaScript

(function(){
var targetType = "bush";
var teleport;
var portalDestination;
var animationURL;
this.enterEntity = function(entityID) {
print("EnterEntity");
};
this.leaveEntity = function(entityID) {
print("leaveEntity");
};
this.getUserData = function() {
if (this.properties.userData) {
this.userData = JSON.parse(this.properties.userData);
} else {
this.userData = {};
}
};
this.updateUserData = function() {
Entities.editEntity(this.entityId, {
userData: JSON.stringify(this.userData)
});
};
this.preload = function(entityId) {
print("!!!! entity preload");
this.entityId = entityId;
this.properties = Entities.getEntityProperties(this.entityId);
this.getUserData();
this.userData.pdType = "bush";
this.userData.pdDescription = "This bush is rather fun!";
this.updateUserData();
};
print("***** Default entity script started.");
});