Nat*_*ate -5 c# stack-overflow xna unhandled
我的代码有问题.我终于得到它所以没有错误,但现在我必须处理stackoverflow ...
谁能告诉我我的代码有什么问题?
public Matrix Projection
{
get { return Projection; }
protected set
{
Projection = value;
generateFrustum();
}
}
Run Code Online (Sandbox Code Playgroud)
如果你可以帮忙的话会很好!
谢谢
Rub*_*ben 24
你的set方法调用自己:Projection = value.
private Matrix _projection = null;
public Matrix Projection
{
get { return _projection; }
protected set
{
_projection = value;
generateFrustum();
}
}
Run Code Online (Sandbox Code Playgroud)
使用以下表格时:
public Matrix Projection { get; set }
Run Code Online (Sandbox Code Playgroud)
你不需要指定变量来存储实际值,但是当你明确地实现get或set时,你应该声明另外的变量并在get,set implementation中使用它.