|
Hi there, I am working on a tile based game. I have the tiles laying out perfectly. The problem is how to name them and then access them again. I have named them as below. pieces[x,z].name = "p"+x + "p" + z; so it should be named p1p1, p1p2 etc. How do I now access these pieces. Like p2p3.x = 50 or something. Thanks Will
(comments are locked)
|
|
If you have the array: If you want to use GameObject.Find (slow): Thanks for that. I guess it might be better to write all the code using the array numbers.
Dec 06 '11 at 10:27 AM
iloveaphextwin
Yes, it's to prefer over finding by name, converting to string, generating a lot of garbage memory etc :)
Dec 06 '11 at 10:34 AM
Statement ♦♦
(comments are locked)
|
