我在C#中经验不足,我习惯在java中工作。我之前已经要求过一些东西,有些人向我提出这样的建议。 链接到我的旧主题here 但我有这个代码的新问题。 Visual Studio说“我不能在struct中有实例提交初始值设定项” - 所以有一些问题,但我真的不明白这个东西,所以在某种程度上可能使这个工作? 我只需要锚点类型Vector3,它是矩阵或数组的数组 - 无论4x4 在Java中,我可能会写它 public Vector3 [] [] = new Vector3 [4] [4];结构中不能有实例字段初始值设定项
这是我的问题的代码:
[StructLayout(LayoutKind.Sequential)]
struct BPatch
{
public Vector3[][] anchors = new Vector3[][] {new Vector3[4],new Vector3[4],new Vector3[4],new Vector3[4]};
public uint dlBPatch;// Display list
public uint texture;// Texture
}
[“无法在结构中有实例字段初始值设定项”问题](http://stackoverflow.com/questions/4406178/cannot-have-instance-field-initializers-in-structs-problem) – nawfal 2013-04-15 10:42:29