The foundation of our app is controlled by four scripts: Time Management, Heart System, Camera Button, and Tracking Event Handler.
Time Management controls the active states of the hearts in the GUI. Using an array, this script will set the active state of each heart in the array to false in thirty second intervals through communicating with a function in the HeartSystem script called HeartDeletion().
Camera Button is connected to the lower button in the GUI that activates the ARCamera. This script is attached to both the coffee button and the pizza button and takes several parameters associated with the button identity to pass into the Tracking Event Handler script. If OnTrackingFound() returns true for the specified image target, then HeartAddition() from the HeartSystem script will initialize.
Tracking Event Handler cross compares what is being scanned in the ARCamera with the image target the CameraButton script has sent it. This is to ensure that the camera doesn’t deinitialize after scanning just any image target in the database, and to make sure that the qilin receives the correct icon popup in the game.
Heart System is connected to both the CameraButton and Time Management scripts, and controls the qilin’s animations and appearance. If the qilins hearts reach zero, the qilin will turn into a pile of bones, otherwise it will be a cute qilin.
We tried to incorporate multiplayer compatibility so that couples can chat and take care of the same qilin. We first did this through the Unity Multiplayer Networking tutorial, however it did not work between PC and mobile phone. This is because there was no server to connect the two devices. Next, we explored Photon Unity after getting advice from Sean. This was better, because Photon uses a cloud that can be accessed just as an API is used. In the short time that we had, we prioritized perfecting the Vuforia camera and the appearance of our app over the networking component. In the future, we hope to finish our work on that part of the app.