- Home /
Boo: Create an array of objects
Hey Guys, I just can't get this working: I want to create an array containing all blocks of my voxel game, but it doesn't work. I've tried the examples from the boo wiki, but they only throw errors! Here's my code: import UnityEngine
public class Block():
def constructor(_id as int, _name as string, _texture as ((int)) ):
id = _id
name = _name
texture = _texture
public static class Blocks (MonoBehaviour):
blockList as (Block) = array(Block, 10)
textures as (((int))) = ( ((0, 0), (0, 0), (0, 0), (0, 0), (0, 0), (0, 0)), ((1, 0), (1, 0), (1, 0), (1, 0), (1, 0), (1, 0)), ((3, 0), (2, 0), (2, 0), (2, 0), (2, 0), (1, 0)) )
def getBlockById(id):
return blockList[id]
blockList[0] = Block(0, "Stone", textures[0])
Thanks in advance!
Comment
only about 0.0000000000000000000001% of people use boo :( maybe if you said what the errors that you are getting say we can have a chance to help you.
I know, and I really don't understand! However I'm just asking how I could make an array of objects of the class Block
Looking back at this question and the feedback in 2017 and is damn weird ins$$anonymous$$d of funny... sorry not providing any solution. Unity Documentation and Boo wiki and Google Search brought me here...