During the past two weeks I was busy with finalizing the code for the shop interaction and helping with some of the UI creation related to the shop.
I finished the code for the shop in the week of 11/15-11/22. This included creating a custom input module that built of the Unity input module to add the functionality we need for our game.
The way I handled input for the shop UI, was to make a pointer from the right hand of the player that the player can use to point at shop items that they want to purchase. The pointer was created by attaching a camera to the right hand and creating a raycast from it. From here the input module checks what data the ray is being cast onto and if a desired button is being pressed or not.
By clicking on an image of the item the code swaps the image on the right hand side to display what item the player wants to buy. Once 'Purchase' is pressed the 'Buy' Script checks if the player has the requisite amount of coins before calling the method associated with the specific item.
As for the UI that I helped with. I simply took the individual layers of images that were put in our Unity project and combined them all into one flat layer in Photoshop so that the hierarchy would not be as cluttered.
In this final week I was just troubleshooting the scripts I wrote and adding some small adjustments that I had missed here and there.
Comments