Using Generic typing.

Hi!

I have this piece of code (simplified version)
I’m running Unity 2.5 version and NOT deveoping for iphone!

public class MyList<T>
{
   T[] data;

   public MyList(int count)
   {
      data = new T[count];
   }
}

The unity editor keeps sending this warning

Couldn't load the script "MyList" because its file name doesn't match the class name.
Please make sure the file name of the script is the same as the class defined inside it.

Anyone have any idea why the is creating this warning? As the use of generic typing is C# 2.0…

Thanks!

Damn… the warning means nothing…

The code can run yet… But it`s annoying…

:smile:

So… generic types relly works in Unity 2.5 … use them more :roll:

They work fine, especially after heavy use of System.Collections.Generic.

just throw a nongeneric class of the same name in and it will work fine.

thats because unity maps class name → class file name

Yep…
inserted a empty private non generic class and worked just fine… Really POG but if it works :smile:

Thanks ppl!