Access factory prototype before creating instance?

Hi all!
Is it possible to access the properties of the prototype .go-file of a factory before creating an instance?
For example, can I determine the sprite size before instantiating a gameobject, when the position depends on the size?
Of course I can instantiate one, read and store the properties, adjust the first one’s position and then carry on with the rest, but that doesn’t seem particularly elegant. Or is there another way that I’ve overlooked?

No, there’s no way to read properties of a go component without actually having an instance of the go.

1 Like

Can you describe in a bit more detail what you are trying to do?

Sorry, didn’t notice the notification until now! :confused:

I was playing around with the runner tutorial, and instead of hardcoding the ground block pool size, I used factories, block width and the screen width to create a screenful of them dynamically. So in essence, calculating the number of objects that’s enough to fill a certain space.

The engine feels generally awesome, but I think this issue (well, “issue”) highlights a pattern that I’m not too comfortable with—some things don’t seem very dynamic. There aren’t very many built-in tools to help with variable screen sizes or objects sizes or scaling things (though it’s easy enough to code yourself), and all references to game objects and components are by name (and not by guid or type which I’d prefer), for example. It nudges you towards hard-coding strings and magic numbers, although you can create a module or a global object to hold values.