How can I add an object I created?

I made a class like this.

jsA.js
class A
{
var a : int;

}

jsB.js
class B
{
var arr : List.;
function Start()
{
arr = new List.

}
function AddThings(newThing : A)
{
arr.Add(A);
}
}

It shows an error "… Add(A)’ is not compatible with the argument list ‘(System.Type)’

How can I declare or add type to an List or array?

Thanks

I made a typo in function AddThings.
arr.Add(A) → arr.Add(newThing);
It works fine. :slight_smile:

In the future, put your script/code in code tags, how-to right here.

//jsA.js
class A
{
  var a : int;
  ....
}

//jsB.js
class B
{
  var arr : List.<A>;
  function Start()
  {
    arr = new List.<A>
  }

  function AddThings(newThing : A)
  {
    arr.Add(newThing); // add object not class.
  }
}

Then it looks all pretty!