Control fuel consumption
More...
|
float | fuelCapacity = 26f |
|
float | fuelBurnRate = 6.1f |
|
UnityEvent | onFuelFull = new UnityEvent() |
|
|
float | CurrentFuel [get] |
|
float | NormalizedFuel [get] |
|
Control fuel consumption
Definition at line 12 of file AC_Airplane_Fuel.cs.
◆ AddFuel()
void AirControl.AC_Airplane_Fuel.AddFuel |
( |
float |
aFuelAmount | ) |
|
|
inline |
Add fuel in case of mid airfueling facility
- Parameters
-
Definition at line 53 of file AC_Airplane_Fuel.cs.
55 currentFuel += aFuelAmount;
56 currentFuel = Mathf.Clamp(currentFuel, 0f, fuelCapacity);
58 if(currentFuel >= fuelCapacity)
60 if(onFuelFull !=
null)
◆ InitFuel()
void AirControl.AC_Airplane_Fuel.InitFuel |
( |
| ) |
|
|
inline |
Initialize full to full capacity
Definition at line 45 of file AC_Airplane_Fuel.cs.
47 currentFuel = fuelCapacity;
◆ ResetFuel()
void AirControl.AC_Airplane_Fuel.ResetFuel |
( |
| ) |
|
|
inline |
Reset fuel in case of mid airfueling facility
Definition at line 69 of file AC_Airplane_Fuel.cs.
71 currentFuel = fuelCapacity;
◆ UpdateFuel()
void AirControl.AC_Airplane_Fuel.UpdateFuel |
( |
float |
aPrecentage | ) |
|
|
inline |
Fuel burnout calculations
- Parameters
-
Definition at line 77 of file AC_Airplane_Fuel.cs.
79 float currentBurn = ((fuelBurnRate * aPrecentage) / 3600f) * Time.deltaTime;
80 currentFuel -= currentBurn;
81 currentFuel = Mathf.Clamp(currentFuel, 0f, fuelCapacity);
84 normalizeFuel = currentFuel / fuelCapacity;
The documentation for this class was generated from the following file: