Created
February 7, 2019 22:48
-
-
Save Atlante45/eebfa9cecc3e47ad53750c1c84e9f75e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var _this = this; | |
_this.preload = function(entityID) { | |
_this.entityID = entityID; | |
_this.interval = Script.setInterval(function(dt) { | |
var parentsCount = 0; | |
var props = Entities.getEntityProperties(_this.entityID); | |
var idToCheck = props.parentID; | |
while (!Uuid.isNull(idToCheck)) { | |
parentsCount += 1; | |
props = Entities.getEntityProperties(idToCheck); | |
idToCheck = props.parentID; | |
} | |
console.log("[TAG] Parents count: " + parentsCount) | |
}, 2000); | |
}; | |
_this.unload = function() { | |
Script.clearInterval(_this.interval); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment