Skip to main content

Class ShareableBatterySystem

A component that manages a shareable portion of the main battery system's energy level.

[RequireComponent(typeof(BatterySystem))]
[DisallowMultipleComponent]
public class ShareableBatterySystem : MonoBehaviour

Inheritance​

Properties​

RuntimeLevel​

Gets or sets the current shareable battery level. If not previously set, returns m_ShareableAmount.

public float RuntimeLevel { get; set; }

Property Value​

float

Remarks​

When set, the battery level is broadcast via the configured event channel.

Methods​

DrainBattery(float)​

Drains both the shareable and main battery systems by the specified amount. The drain amount is clamped to the current shareable level.

public void DrainBattery(float drainAmount)

Parameters​

NameTypeDescription
drainAmountfloatAmount to drain from both battery levels.