Asylum – Developer Diary Day 53
Unity 4.6 (beta) is now available. And so it was time for me to pick apart the current GUI implementation I have in Asylum and replace it with the super sleek Unity UI. This was more involved than I expected as it adds a new event based system that I wasn’t expecting. Previously it was a case of adding an OnClick() function to a script that was attached to a GameObject but with the new UI system you can add multiple scripts to a single OnClick handler.
With this in mind I had to work out how to reference the gameobjects variables (the click handlers only allow for one parameter). The current UI tutorials are a bit lacking at the moment.
Anyway, after a couple of days of experimentation I worked it all out and now have the flashlight UI and the two key pads that are currently in the game operating exactly how they did under the previous NGUI implementation.
And so development can now continue as before.