The script for the diary pickup is very long so I split it into 4 parts here. It's using the GUI Style system and took a while to implement. It works by checking for a note on click and running a check for note routine, if reading the note is true which will happen if the mouse is clicked over the object called 'Note', then the GUI will draw the GUI Style onto the screen. The OnGUI shows you which style is going to show up when you click and you set that in the inspector by dragging the style over. The Time.Timescale and mouseLook control whether the player can move or move the camera around whilst reading the note, essentially like a pause. The script is made so when the player clicks it cycles through a series of pictures and then closes when done looking through all of them.
Megan created the texture for these note pickups. As you click it starts with the diary page at the back and adds pages on as you click as if you're laying them on top of each other as you look through the diary.
Here you can see the diary as it appears in the scene before you pick it up. On the wall is one of a few pictures you can 'pick up' and look at around the house. Sophie made the textures for the child's drawing pictures. The script for this is the same as the one for the diary, only you need to add the section above instead of the note++ bit as you aren't cycling through images but rather picking one up and putting it back down. These two were the hardest of the scripts I had to do and I learnt a lot of scripting stuff doing this. I think for the future I'll learn to use something other than GUI Style as now we have an updated Unity we have access to Canvas. GUI Style is a bit outdated now and also very complicated to use so it will be beneficial to learn something other than GUI Style.
No comments:
Post a Comment