Energy Based Objects  2.01
Public Member Functions | Public Attributes
EnergyUser Class Reference

Use up Energy when a ObjectShootingPoint is shot. More...

Inheritance diagram for EnergyUser:
IComponentEventConnector

List of all members.

Public Member Functions

void UseEnergy ()
 Takes the required amount of energy from specified sources if available.
bool CheckEnergy ()
 Checks if the specified Energy sources have enough Energy.
Energy[] GetEnergy ()
 Looks for available Energy sources and returns them.
Energy[] GetNonEmptyEnergy ()
 Looks for available Energy sources that aren't empty and returns them.
void ConnectShootingPoint (ObjectShootingPoint point)
void DisconnectShootingPoint (ObjectShootingPoint point)
void ConnectComponentEvent (Component component)
void DisconnectComponentEvent (Component component)

Public Attributes

GameObject energyContainer
 The object holding the Energy
float useAmount = 1
 Minimum amount of Energy that is required for this weapon/object.
bool multiplyDeltaTime = true
 When energy is taken, the actual amount taken will be multiplied by Time.deltaTime. Use this for weapons/objects that should take energy per-frame rather than per-shot.
bool checkSelfEnergy = true
 Check the Energy component that is on this object.
bool checkChildrenEnergy = true
 Check the Energy components that are on this object's and the energyContainer's children.

Detailed Description

Use up Energy when a ObjectShootingPoint is shot.


Member Function Documentation

bool CheckEnergy ( )

Checks if the specified Energy sources have enough Energy.

Returns:
Has enough Energy
Energy [] GetEnergy ( )

Looks for available Energy sources and returns them.

Returns:
Available Energy sources
Energy [] GetNonEmptyEnergy ( )

Looks for available Energy sources that aren't empty and returns them.

Returns:
Available Energy sources that aren't empty
void UseEnergy ( )

Takes the required amount of energy from specified sources if available.


Member Data Documentation

bool checkChildrenEnergy = true

Check the Energy components that are on this object's and the energyContainer's children.

bool checkSelfEnergy = true

Check the Energy component that is on this object.

GameObject energyContainer

The object holding the Energy

bool multiplyDeltaTime = true

When energy is taken, the actual amount taken will be multiplied by Time.deltaTime. Use this for weapons/objects that should take energy per-frame rather than per-shot.

float useAmount = 1

Minimum amount of Energy that is required for this weapon/object.

 All Classes Namespaces Functions Variables Properties Events