So every time you turn on an isPickupPoint/isDeliveryPoint bool on a DropPoint, it will add itself to the corresponding list in the PickupManager. It works surprisingly well (even though OnValidate might sometimes be unreliable) and proved to be a much cleaner way to edit the settings than to manually assign the lists.
The Pickup script is placed on the actual pickup object and is in charge of attaching itself like a magnet to a transform parented to the player when the player is close to the pickup. It also controls the player’s health, when the player drops it too hard the health will run out and the player will lose a life. When the pickup is dropped it will also interface with the Sfx script to play an impact sound. This is only when the pickup is not being held though. When the pickup is held, the player script is in charge of handling collision damage, fire from enemies, etc. The player can only take damage when it is holding a pickup however, design-wise this makes the pickup’s condition be the purpose of the health bar. If the pickup gets too damaged the customer won’t want to receive it.
Now that you understand what each script handles, let’s go through what happens during one job. At the start of the job, the PickupManager chooses a random pickup point and a random delivery point. Then the pickup spawns (object’s position is set and the GameObject is enabled) at the pickup point. A beacon at the pickup location is activated and a timer is set and started with a random amount of seconds based on a customizable range. When picking the pickup up for the first time during that job, the music will change, the health will be set and the beacon will now instead lead you to the delivery point. If you drop the pickup too hard, get shot (when carrying it), or collide with objects (also when carrying it) you will lose health and eventually die. You will also instantly fail if you drop the pickup off the map or if the timer runs out.
When dropping the pickup off at the delivery point the score is based on the remaining health, the number of seconds left in the timer, and how close to the middle of the delivery point the pickup was dropped at. Those points are added to a variable in the GameManager that tracks the current points.