- Home /
What is the javascript equivalent of "using"?
I want to make a custom variable type using Javascript instead of C# if possible. What would be the javascript equivalent of the following lines for my javascript class? (I've done a simple one before in C# to create n dimensional arrays but I'm not familiar enough with C# to do a large complex class with it in a short period of time.)
using UnityEngine;
using System.Collections;
I know javascript files are monobehavior extensions by default but that wouldn't be practical for this class ( A pseudo variable hashtable attached to a file and updating it after any changes ) I'm already using
import System;
import System.IO;
Do I just import System.Collections as well or should that be what it Extends?
Answer by Mike 3 · Mar 28, 2011 at 12:15 PM
It's import, yeah, e.g.
import System.Collections.Generic;
For the class itself, don't use an implicit class, use
public class MyClassName
{
//code
}
That'll let you create your own class however you like, using
public class MyClassName extends Whatever
to extend other classes
"INIFile must be instantiated using the ScriptableObject.CreateInstance method..." I guess it's still a component?
Never$$anonymous$$d, forgot to clear the original error in the console. :P :facepalm: