I wrote a C# class with a number of parsing functions for a large string of data. I want to call it like this:
var dataToParse = "..very..long..string";
var myData: MyClassName = new MyClassName (dataToParse);
myData.Parse();
myData.Count();
myData.Execute();
// Ect...
In my CS file I have something like:
public class MyClassName : MonoBehaviour{
private string _rawCode;
private ArrayList _parsedCode;
// I can't get a constructor to work
void Init(string dataIn) {
_rawCode = dataIn;
}
public int Count () {
return _parsedCode.Length;
}
...
}
When I try to define in it in the UnityScript code, I get this error:
I recall getting something like this to work a while ago in Unity v2.x. I’ve upgraded to v3.0 and I’m tripping over what I thought was a pretty common usage of a helper class. Have things changed and how does one do this in v3.0?
Thanks for any info!