Hi all!
I'm trying to add a script dependency to my addon. I'm using the addon sdk1 for now.
Following the manual, these are the steps I took:
- Added the dependency script in \c3runtime folder
- Specified the dependency in the behavior info using this._info.AddFileDependency
- Specified the script file in "file-list" inside addon.json
If I try to call a function from the script, I get an error saying that the function is not defined. However, a console.log inside the script shows up on the browser console, meaning that the script at least is loaded.
Is there anything I'm doing wrong? (I'm using developer mode btw)
This is how I add the dependency in behavior.js
this._info.AddFileDependency(
{
filename: "c3runtime/voronoi.js",
type: "inline-script"
});
In "file-list" I added "c3runtime/voronoi.js"
And this is the script i'm tring to use (calling new Voronoi()
):