History

script entities

HifiExperiments committed 1 year ago

Commit efd26391 parent e9d4e2738 files · +1661 −143Browse files

Showing the changes to libraries/script-engine/src/ScriptManagerScriptingInterface.h (1 of 38 files). Show all

Unified · Split

libraries/script-engine/src/ScriptManagerScriptingInterface.h+20−4
@@ -407,12 +407,13 @@ public: · 406 unmodified lines
407407 // Entity Script Related methods
408408
409409 /*@jsdoc
410− * Checks whether an entity has an entity script running.
410+ * Checks whether a specific script URL is running on an entity.
411411 * @function Script.isEntityScriptRunning
412412 * @param {Uuid} entityID - The ID of the entity.
413− * @returns {boolean} <code>true</code> if the entity has an entity script running, <code>false</code> if it doesn't.
413+ * @param {string} scriptURL - The script URL.
414+ * @returns {boolean} <code>true</code> if the entity has the entity script running, <code>false</code> if it doesn't.
414415 */
415− Q_INVOKABLE bool isEntityScriptRunning(const EntityItemID& entityID) { return _manager->isEntityScriptRunning(entityID); }
416+ Q_INVOKABLE bool isEntityScriptRunning(const EntityItemID& entityID, const QString& scriptURL) { return _manager->isEntityScriptRunning(entityID, scriptURL); }
416417
417418 /*@jsdoc
418419 * Manually runs the JavaScript garbage collector which reclaims memory by disposing of objects that are no longer
@@ -440,10 +441,25 @@ public: · 21 unmodified lines
440441 /*@jsdoc
441442 * @function Script.unloadEntityScript
442443 * @param {Uuid} entityID - Entity ID.
444+ * @param {string} scriptURL - Script URL to unload.
443445 * @param {boolean} [shouldRemoveFromMap=false] - Should remove from map.
444446 * @deprecated This function is deprecated and will be removed.
445447 */
446− Q_INVOKABLE void unloadEntityScript(const EntityItemID& entityID, bool shouldRemoveFromMap = false) { _manager->unloadEntityScript(entityID, shouldRemoveFromMap); }
448+ Q_INVOKABLE void unloadEntityScript(const EntityItemID& entityID,
449+ const QString& scriptURL,
450+ bool shouldRemoveFromMap = false) {
451+ _manager->unloadEntityScript(entityID, scriptURL, shouldRemoveFromMap);
452+ }
453+
454+ /*@jsdoc
455+ * @function Script.unloadAllEntityScriptsForEntity
456+ * @param {Uuid} entityID - Entity ID.
457+ * @param {boolean} [shouldRemoveFromMap=false] - Should remove from map.
458+ * @deprecated This function is deprecated and will be removed.
459+ */
460+ Q_INVOKABLE void unloadAllEntityScriptsForEntity(const EntityItemID& entityID, bool shouldRemoveFromMap = false) {
461+ _manager->unloadAllEntityScriptsForEntity(entityID, shouldRemoveFromMap);
462+ }
447463
448464 /*@jsdoc
449465 * @function Script.unloadAllEntityScripts