Wednesday 6 April 2016

Games Art - Unity Code

In regards to coding the project there was a fair few areas to consider and thus I will write about each individually below.


Icons

Creating the map icons to be interactable was just a matter of setting up a OnMouseEnter trigger to enable a button with the locations name on it to appear. This would then disppear when the mouse wasn't on the icon again. I then made use of the OnButtonDown of the button to change the canvas by turning the locations one on and the current one off. This is essentially also how the exit buttons work as well. Just moving in the opposite direction within the heirachy.

Menus

The menus again use a simple OnMouseEnter and OnMouseDown to translate the menu between a seen and unseen position respectively. Again not a hard set of code to do.


Enlargement

The enlargement of the model sheet was the hardest element. I had to set it to resize whilst lerping it to the middle position. This feels a bit buggy but does the work. However this is a section of code that I am not so happy with.

No comments:

Post a Comment