|
Okay, so what I want to do is create a Tile everywhere there is an "X". so what I think i would do is: So I would instantiate a gameobject for every X but for "O" I would instantiate a wall... How do you do this?
(comments are locked)
|
|
How about this- instead of using a string like that, why don't you use an array of booleans? (actually integers, since they're smaller...)
Then, to instantiate objects over a space, do something like this-
Please note that you can't assign these in the editor, or keep them serialised along with your other properties. You either have to hardcode them, or use a special custom editor. (forgive incorrect syntax, I'm not fantastic at javascript. If someone who knows more than me can find any problems, please tell me!)
Jan 08 '12 at 11:13 AM
syclamoth
If you know C# Can you write that :) I'm trying to learn C# :)
Jan 08 '12 at 11:15 AM
Wikened
Well, C# is basically like what I put there, but with some details changed. I'll change my answer to correct C#.
Jan 08 '12 at 11:44 AM
syclamoth
It didn't work :/ I keep getting lots of errors. Could you maybe try to fix it in an editor? You would help me soooo much! :D
Jan 08 '12 at 02:10 PM
Wikened
Well, obviously that wasn't intended as completed code! It's really just a guide for what you need to do. What errors are you getting? You need to define a public GameObject 'obj' to use as the instantiated tile prefab.
Jan 08 '12 at 03:14 PM
syclamoth
(comments are locked)
|
