Upgrades Interface - NeisesMike/VehicleFramework GitHub Wiki

The upgrades interface is what the player will touch in order to add, remove, and swap upgrade modules. When the player clicks this, it will bring up the PDA page for doing these things.

ModVehicle has the following fields:

public virtual List<VehicleParts.VehicleUpgrades> Upgrades => new List<VehicleParts.VehicleUpgrades>();
public virtual int NumModules => 4;
public virtual bool HasArms => false;

NumModules defines how many upgrades your vehicle can accept.

HasArms controls whether your vehicle can accept arm upgrades. If true, 2 extra upgrade slots are added in addition to NumModules.

A ModVehicle can actually have several upgrades interfaces.

Here is the definition of the VehicleUpgrades struct.

public struct VehicleUpgrades
{
    public GameObject Interface;
    public GameObject Flap;
    public Vector3 AnglesOpened;
    public Vector3 AnglesClosed;
    public List<Transform> ModuleProxies;
}

Interface is the "Upgrade Console Panel" that you use to add and remove upgrades to your vehicle. Be sure this GameObject has a collider!

Flap is an optional component that will be rotated when the player clicks the interface. Think about how the Seamoth and Prawn work. If you don't want to use this, set it as Flap = Interface; to ignore it.

AnglesOpened describes the way the Flap will be rotated when the upgrades interface is being used. Set this to Vector3.zero to ignore it.

AnglesClosed describes the way the Flap will be rotated when not in use. Set this to Vector3.zero to ignore it.

ModuleProxies is a list of locations for physical upgrades to go. Normally an upgrades interface will begin with several empty upgrade slots. When the player adds one, they expect an empty slot to now have an upgrade in it. This is a nice cosmetic thing, but you can leave this null.

⚠️ **GitHub.com Fallback** ⚠️