- Home /
List of Objects in Boo
Hey Guys, I'm wondering why I can't add values to my List, It works if the class isn't self defined for example:
private newVertices as List[of Vector3] = List[of Vector3]()
newVertices.Add(Vector3(x, y, (z + 1)))
but not this way: import UnityEngine
public class BlockTexture(): // function parameters are the position in the texture
def constructor(_top as int, _north as int, _east as int, _south as int, _west as int, _bottom as int):
top = _top
north = _north
east = _east
south = _south
west = _west
bottom = _bottom
public class Block():
def constructor(_name as string, _texture as List ):
id = len(Blocks.blockList)
name = _name
texture = _texture
public static class Blocks (MonoBehaviour):
public blockList as List[of Block] = List[of Block]()
def getBlockById(id):
return blockList[id]
blockList.Add( Block("Stone", BlockTexture(0, 0, 0, 0, 0, 0) ) )
Is there any way to append to such a list? (And please don't tell me that BOO is a bad language! That's not what I'm asking for.)
Thanks in advance!
Comment