mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
pass parameters to entities
This commit is contained in:
parent
b229b5289c
commit
3cee569bae
4 changed files with 5 additions and 0 deletions
|
@ -20,6 +20,7 @@
|
|||
class EntitiesScriptEngineProvider {
|
||||
public:
|
||||
virtual void callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName) = 0;
|
||||
virtual void callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const QStringList& params) = 0;
|
||||
};
|
||||
|
||||
#endif // hifi_EntitiesScriptEngineProvider_h
|
|
@ -15,6 +15,7 @@
|
|||
#define hifi_EntityScriptingInterface_h
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
#include <DependencyManager.h>
|
||||
#include <Octree.h>
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <QtNetwork/QNetworkReply>
|
||||
#include <QtScript/QScriptEngine>
|
||||
#include <QtScript/QScriptValue>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
#include <AudioConstants.h>
|
||||
#include <AudioEffectOptions.h>
|
||||
|
@ -1225,6 +1226,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS
|
|||
if (entityScript.property(methodName).isFunction()) {
|
||||
QScriptValueList args;
|
||||
args << entityID.toScriptValue(this);
|
||||
args << qScriptValueFromSequence(this, params);
|
||||
entityScript.property(methodName).call(entityScript, args);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <QtCore/QSet>
|
||||
#include <QtCore/QWaitCondition>
|
||||
#include <QtScript/QScriptEngine>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
#include <AnimationCache.h>
|
||||
#include <AnimVariant.h>
|
||||
|
|
Loading…
Reference in a new issue