Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.ECBehaviorPlaySoundRandom Class Reference

Extends ECBehaviorPlaySound to pick sound to play randomly from a list of sounds. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorPlaySoundRandom:
Dragengine.Scenery.ECBehaviorPlaySound Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

class  Instance
 Behavior instance. More...
 

Public Member Functions

ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 
ECPSoundList getSounds ()
 Speaker sounds. More...
 
ECBehaviorPlaySoundRandom new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorCollider collider)
 Create behavior element class. More...
 
ECBehaviorPlaySoundRandom new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorCollider collider, String id)
 Create behavior element class. More...
 
ECBehaviorPlaySoundRandom new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorCollider collider, String id, String prefix)
 Create behavior element class. More...
 
ECBehaviorPlaySoundRandom new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorCollider collider, TSTriggerTable triggerTable)
 Create behavior element class. More...
 
ECBehaviorPlaySoundRandom new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorCollider collider, TSTriggerTable triggerTable, String id)
 Create behavior element class. More...
 
ECBehaviorPlaySoundRandom new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorCollider collider, TSTriggerTable triggerTable, String id, String subId)
 
ECBehaviorPlaySoundRandom new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorCollider collider, TSTriggerTable triggerTable, String id, String subId, String prefix)
 
- Public Member Functions inherited from Dragengine.Scenery.ECBehaviorPlaySound
void dispose ()
 Dispose of behavior. More...
 
ECPString getBone ()
 Name of bone to use to null if not used. More...
 
ECBehaviorCollider getCollider ()
 Collider behavior or null if not used. More...
 
ECBehaviorComponent getComponent ()
 Component behavior or null if not used. More...
 
ECPFloat getDistanceOffset ()
 Distance offset for attenuation calculation. More...
 
LayerMask getLayerMask ()
 Layer mask. More...
 
ECPVector getOrientation ()
 Orientation relative to element. More...
 
ECPFloat getPlaySpeed ()
 Play speed. More...
 
ECPVector getPosition ()
 Position relative to element. More...
 
String getPrefix ()
 Prefix. More...
 
ECPFloat getRange ()
 Speaker range. More...
 
ECPFloat getRollOff ()
 Half volume distance. More...
 
ECPSound getSound ()
 Speaker sound. More...
 
ECPEnumeration getSpeakerType ()
 Speaker type. More...
 
ECBehaviorTriggered getTrigger ()
 Trigger play sound. More...
 
TSTriggerTable getTriggerTable ()
 Trigger table or null if not used. More...
 
ECPFloat getVolume ()
 Speaker volume. More...
 
Instance instance (BehaviorElement element)
 Get instance in element from owner element class. More...
 
void set (String sound, float range, float volume)
 Set to point speaker with parameters. More...
 
void set (String sound, float range, float volume, Vector position)
 
void set (String sound, float range, float volume, Vector position, Vector orientation)
 
void set (String sound, float range, float volume, Vector position, Vector orientation, String bone)
 
void setLayerMask (LayerMask layerMask)
 Set layer mask. More...
 
- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index. More...
 
String getBehaviorID ()
 Unique identifier of behavior. More...
 
String getID ()
 Identifier. More...
 
int getInstanceIndex ()
 Instance index. More...
 
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior. More...
 
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Dragengine.Scenery.ECBehaviorPlaySound
static ECBehaviorPlaySound getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent. More...
 
- Protected Member Functions inherited from Dragengine.Scenery.ECBehaviorPlaySound
void setTriggerTable (TSTriggerTable triggerTable)
 Set trigger table or null if not used. More...
 
- Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
DefaultECBehavior new (BehaviorElementClass eclass)
 Create default composeable behavior with empty identifier. More...
 
DefaultECBehavior new (BehaviorElementClass eclass, String id)
 Create default composeable behavior. More...
 
void setBehaviorID (String identifier)
 Set behavior identifier. More...
 
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>". More...
 
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More...
 

Detailed Description

Extends ECBehaviorPlaySound to pick sound to play randomly from a list of sounds.

Useful for situations where random sounds from a list of sounds have to be played each time the behavior is triggered. If random sound list is empty behaves the same as ECBehaviorPlaySound.

This behavior does not require the element class to be persistable (setPersistable).

Member Function Documentation

◆ createInstance()

ECBehaviorInstance Dragengine.Scenery.ECBehaviorPlaySoundRandom.createInstance ( BehaviorElement  element)

Create Behavior instance.

Implements Dragengine.Scenery.ECBehavior.

◆ getSounds()

ECPSoundList Dragengine.Scenery.ECBehaviorPlaySoundRandom.getSounds ( )

Speaker sounds.

◆ new() [1/7]

ECBehaviorPlaySoundRandom Dragengine.Scenery.ECBehaviorPlaySoundRandom.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorCollider  collider 
)

Create behavior element class.

Reimplemented from Dragengine.Scenery.ECBehaviorPlaySound.

◆ new() [2/7]

ECBehaviorPlaySoundRandom Dragengine.Scenery.ECBehaviorPlaySoundRandom.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorCollider  collider,
String  id 
)

Create behavior element class.

Reimplemented from Dragengine.Scenery.ECBehaviorPlaySound.

◆ new() [3/7]

ECBehaviorPlaySoundRandom Dragengine.Scenery.ECBehaviorPlaySoundRandom.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorCollider  collider,
String  id,
String  prefix 
)

Create behavior element class.

Reimplemented from Dragengine.Scenery.ECBehaviorPlaySound.

◆ new() [4/7]

ECBehaviorPlaySoundRandom Dragengine.Scenery.ECBehaviorPlaySoundRandom.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorCollider  collider,
TSTriggerTable  triggerTable 
)

Create behavior element class.

Reimplemented from Dragengine.Scenery.ECBehaviorPlaySound.

◆ new() [5/7]

ECBehaviorPlaySoundRandom Dragengine.Scenery.ECBehaviorPlaySoundRandom.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorCollider  collider,
TSTriggerTable  triggerTable,
String  id 
)

Create behavior element class.

Reimplemented from Dragengine.Scenery.ECBehaviorPlaySound.

◆ new() [6/7]

ECBehaviorPlaySoundRandom Dragengine.Scenery.ECBehaviorPlaySoundRandom.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorCollider  collider,
TSTriggerTable  triggerTable,
String  id,
String  subId 
)

◆ new() [7/7]

ECBehaviorPlaySoundRandom Dragengine.Scenery.ECBehaviorPlaySoundRandom.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorCollider  collider,
TSTriggerTable  triggerTable,
String  id,
String  subId,
String  prefix 
)

The documentation for this class was generated from the following file: