Next, we have the start function. This will run when the game starts. It will first set the projectile type to the most basic type, as thats what you start out with. Next it sets health to mac, and sets the healthbar to the proper gameobject. It then sets all of the projectile stats to 0, and assigns the camera to the Cameraholder.
In order to have more options with the camera for Debug reasons, I followed an online tutorial for enumerators, which is a set of rules to follow, which can be switched. I set up four camera types: Lerp, MoveTowards, AccelDecl, and Acceleration.
The different Camera types were used in the switch function below.
What is happening in this switch function is that based on which option is selected (out of the four above,) it will change the way the function is called. For example, if the camera type is set to lerp, it will use the CameraMovementType.Lerp case, which will make the camera lerp between positions.
The disFromCamera Vector3 is getting how far away the player is from the camera. It is followed by several if statements checking the distance, and setting whether the camera is moving or not. If the camera is moving, it will call the CameraMovement function.
After that, its setting the projectile spawn to the players locations, and also setting the healthbar to the current health.