Scriptable Object Syntax in Javascript

Clarification: I can’t figure out how to make scriptableObjects in Javascript. No examples are anywhere on the website- all the example code is in C#. Help!

Original message:
Hey folks,

I’m trying to make some scriptable objects to contain variables and functions for different tools in my game. However, I can’t find how I’m supposed to make 'em in Javascript so that my other Javascript scripts can see/interact with them. I made the desired scripts in C#, but none of my other scripts can see them of course.

I want to ask, once and for all, how do you make a javascript scriptable object? I found somewhere

class MyScriptableObject extends ScriptableObject{ }

So I wrote,

class ToolBehavior extends ScriptableObject{}

and hoped to use “extend” to use it as an abstract class, like this:

class WelderTool extends ToolBehavior{}

But this results in nothing; I can’t plug either ToolBehavior nor WelderTool in as a ToolBehavior variable in the inspector. It doesn’t want to be attached like a monobehavior either.

Halp! One working example code would do it!

So is the problem that you have defined ScriptableObject classes in javascript, and you are not able to successfully use them with C# classes? If that’s the case, the JavaScript classes must be compiled in an earlier pass than the C# ones. You may find this page in the documentation helpful.