这是简单的解释: 这个作品堆栈溢出异常
using System;
using ConstraintSet = System.Collections.Generic.Dictionary<System.String, double>;
namespace ConsoleApplication2
{
class test
{
public ConstraintSet a { get; set; }
public test()
{
a = new ConstraintSet();
}
static void Main(string[] args)
{
test abc = new test();
Console.WriteLine("done");
}
}
}
这并不
using System;
using ConstraintSet = System.Collections.Generic.Dictionary<System.String, double>;
namespace ConsoleApplication2
{
class test
{
public ConstraintSet a { get { return a; } set { a = value; } }
public test()
{
a = new ConstraintSet();
}
static void Main(string[] args)
{
test abc = new test();
Console.WriteLine("done");
}
}
}
我得到一个堆栈溢出异常上的二传手在第二类和我做不知道为什么。我不能使用第一种形式,因为它不受统一引擎的支持
'我不能使用第一种形式,因为它不是由统一engine'支持...第一种形式是一个编译器级的简写。它应该适用于统一引擎。 – SLaks 2010-07-18 15:44:48
[类属性上的StackOverFlow]的可能重复(http://stackoverflow.com/questions/680765/stackoverflow-on-class-property)以及其他许多。 – 2010-07-18 15:45:55
nope,unity c#编译器不支持这种语法 – Patrik 2010-07-18 15:56:41