c# - Infinite objects declaration in script -


i have script in unity holds checkpoints in racing game. don't know how many checkpoints on racetracks. limited 5:

enter image description here

but, allow map makers insert more checkpoints. doesn't work:

public list<gameobject> checkpoints = new list<gameobject>(); 

so best way this?

wouldn't defining array of checkpoints work?

public gameobject[] checkpoints;

i don't have access unity @ moment, should allow enter (reasonable) number of gameobjects via inspector checkpoints array.

this on unity answers similar question: http://answers.unity3d.com/questions/245024/public-array-of-gameobjects.html

taking wild guess here, error list1' not found? in case you'll have add using system.collections.generic; able use c# lists.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -