Vehicle
Last updated
Last updated
Vehicle is a system that drives Player's mechanic. Examples :
SpringBoots
Monkey
etc.
Player will always have one active vehicle attached to it. The default Vehicle is called DefaultVehicle
. This is when Player doesn't "ride" any animals.
Switching to new vehicle will destroy / disable the currently attached vehicle, and instantiate the new one. This is done in VehicleController
component.
Note : vehicle is "switched" in one of the following condition :
colliding with Enemy with "vehicle" data
current vehicle's effect is completed. In this case, the vehicle will be reverted to DefaultVehicle
some special case (e.g. Revive)
Each vehicle has its own prefab, and contains these following base components:
VehicleControl
: to handle movement
VehicleView
: to handle vehicle's spine animations
VehicleCollision
: to manage vehicle's collision resolution with another object
VehicleFSM
: to manage states in the vehicle. Uses MonoBehaviourFSM.
Each new vehicle will have to derive from the above components and create a specific implementation based on the mechanic design.