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
407 // Entity Script Related methods407 // Entity Script Related methods
408 408
409 /*@jsdoc409 /*@jsdoc
410 * Checks whether an entity has an entity script running.410 * Checks whether a specific script URL is running on an entity.
411 * @function Script.isEntityScriptRunning411 * @function Script.isEntityScriptRunning
412 * @param {Uuid} entityID - The ID of the entity.412 * @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.
414 */415 */
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); }
416 417
417 /*@jsdoc418 /*@jsdoc
418 * Manually runs the JavaScript garbage collector which reclaims memory by disposing of objects that are no longer419 * 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
440 /*@jsdoc441 /*@jsdoc
441 * @function Script.unloadEntityScript442 * @function Script.unloadEntityScript
442 * @param {Uuid} entityID - Entity ID.443 * @param {Uuid} entityID - Entity ID.
444 * @param {string} scriptURL - Script URL to unload.
443 * @param {boolean} [shouldRemoveFromMap=false] - Should remove from map.445 * @param {boolean} [shouldRemoveFromMap=false] - Should remove from map.
444 * @deprecated This function is deprecated and will be removed.446 * @deprecated This function is deprecated and will be removed.
445 */447 */
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 }
447 463
448 /*@jsdoc464 /*@jsdoc
449 * @function Script.unloadAllEntityScripts465 * @function Script.unloadAllEntityScripts