lua不支持的泛型方法

1.没有泛型约束

2.缺少带约束的泛型参数

3.泛型约束必须为class

 1     /// <summary>
 2     /// 不支持生成lua的泛型方法(没有泛型约束)
 3     /// </summary>
 4     public void UnsupportedMethod1<T>(T a)
 5     {
 6         Debug.Log("UnsupportedMethod1");
 7     }
 8 
 9     /// <summary>
10     /// 不支持生成lua的泛型方法(缺少带约束的泛型参数)
11     /// </summary>
12     public void UnsupportedMethod2<T>() where T : Foo1Parent
13     {
14         Debug.Log(string.Format("UnsupportedMethod2<{0}>",typeof(T)));
15     }
16 
17     /// <summary>
18     /// 不支持生成lua的泛型方法(泛型约束必须为class)
19     /// </summary>
20     public void UnsupportedMethod3<T>(T a) where T : IDisposable
21     {
22         Debug.Log(string.Format("UnsupportedMethod3<{0}>", typeof(T)));
23     }

猜你喜欢

转载自www.cnblogs.com/jgsbwcx/p/8972532.html