Maze Tutorial
The Maze tutorial is now online! It's a big one. Thank you all for your support!
http://catlikecoding.com/unity/tutorials/maze/
Comments (2)
Hey, I'm having issues getting the Maze's size struct to appear in the editor. I have added [System.Serializable] to IntVector2, in fact I have downloaded your maze-03 package and no go. When I load yours up. it shows at first, but as soon as I make any changes or just save again one of the scripts, it disappears. I have searched around and have found a lot of posts from 2012 that mention that structs are not serializable. I have set the values programatically and moved on, but could you shed some light on whether I am doing somethign wrong? (Unity 4.3.0f4) Cheers
Yes, serialized structs are a new feature of Unity 4.5. I added a note at the start of the tutorial that it's for 4.5, about a day after its release. You can make it work in 4.3 if you want. You need to turn IntVector2 into a class and make sure the plus operator method creates a new IntVector2 and doesn't modify its arguments in any way.
