How to declare an array of objects in C#

后端 未结 7 435
春和景丽
春和景丽 2020-12-23 16:12

I have a very beginning C# question. Suppose I have a class called GameObject, and I want to create an array of GameObject entities. I could think

7条回答
  •  有刺的猬
    2020-12-23 16:48

    Everything you have looks fine.

    The only thing I can think of (without seeing the error message, which you should have provided), is that GameObject needs a default (no parameter) constructor.

提交回复
热议问题