Support => TNet 3 Support => Topic started by: lynohd on August 20, 2016, 12:43:54 PM
Title: List<> problem
Post by: lynohd on August 20, 2016, 12:43:54 PM
Hi, for some reason when i wanna use a list it gives me an error message saying: Error CS0104 'List<>' is an ambiguous reference between 'TNet.List<T>' and 'System.Collections.Generic.List<T>'
is there any ways to use a list with TNET imported without having to put TNet.List infront of everything?
thanks in advance
Title: Re: List<> problem
Post by: ArenMook on August 20, 2016, 02:13:34 PM
Remove "using Systems.Collections.Generic;" from the top of your file, and there won't be a conflict.
Title: Re: List<> problem
Post by: lynohd on August 20, 2016, 02:19:39 PM
Thanks, But now it wont show up in the inspector anymore.. :-\
Title: Re: List<> problem
Post by: ArenMook on August 20, 2016, 02:29:26 PM
You can still use System.Collections.Generic.List for your inspector if you like. You just need to prefix it.
It is not perfect by any means, but it is easier than typing out the full namespace every time. I just wonder why Aren has named his class in TNet List<> when in NGUI he has another one called BetterList<>. Maybe they could be consolidated into one class into part of something like "Tasharen Standard Assets"?
Title: Re: List<> problem
Post by: ArenMook on August 20, 2016, 04:16:39 PM
TNet is newer and better designed than NGUI, so it takes advantage of namespaces (which were not supported by Unity at the time NGUI was first created). List<> is meant to be a replacement of the generic one, which is why I named it the same. It's still in a namespace to make it possible to use both.