Class "DanmakuContext"

Namespace: VirtualDropkick.DanmakuEngine.Unity

Summary

The execution context which bullet-sources operate on (see DanmakuBulletSource)


Public Members

string name
The name of this context

BulletLibrary bulletLibrary
A reference to the bullet library which will be used by this context

float timeScale
The time-scale of this context (default value: 1.0f)

Transform bulletContainer
A reference to the parent Transform for all spawned bullet-sources (can be null)


Delegates

DanmakuBullet BulletCreationCallback(BulletModel bulletModel)
Delegate for creating a bullet

void BulletDestructionCallback(DanmakuBullet bullet)
Delegate for destroying a bullet

DanmakuEmitter EmitterCreationCallback(EmitterModel emitterModel)
Delegate for creating an emitter

void EmitterDestructionCallback(DanmakuEmitter emitter)
Delegate for destroying an emitter

Transform ResolveTargetCallback(DanmakuBulletSource source)
Delegate for resolving a target in relation to the given source which requested the target

void TriggerEvent(string triggerName,
                  IDictionary<string, string> parameters,
                  DanmakuBulletSource bulletSource)

Delegate for the OnTrigger-event. The argument bulletSource is the bullet-source which fired the trigger with the name triggerName.
Note, that the parameters-dictionary is null if no parameters are provided.

float VariableResolver()
Delegate for parameterless functions that are used to resolve global variables which can be used in DanmakuJSON-Terms


Events

TriggerEvent OnTrigger
Gets fired when a bullet-source executes the trigger-action. Register listeners to this event for handling triggers.
Note, that the parameters-dictionary is null if no parameters are provided.


Public Properties

float DeltaTime
Returns the time it took to complete the last frame. Note, that the result of this property depends on the used time-calculation.

BulletCreationCallback BulletCreationHandler
Callback for custom construction handling of bullets (Overrides the default behaviour of this context)

BulletDestructionCallback BulletDestructionHandler
Callback for custom destruction handling of bullets (Overrides the default behaviour of this context)

EmitterCreationCallback EmitterCreationHandler
Callback for custom construction handling of emitters (Overrides the default behaviour of this context)

EmitterDestructionCallback EmitterDestructionHandler
Callback for custom destruction handling of emitters (Overrides the default behaviour of this context)

ResolveTargetCallback ClosestTargetResolver
Callback for custom determination of the closest target (Overrides the default behaviour of this context)

ResolveTargetCallback FarthestTargetResolver
Callback for custom determination of the farthest target (Overrides the default behaviour of this context)

ResolveTargetCallback RandomTargetResolver
Callback for custom determination of a random target (Overrides the default behaviour of this context)

Transform[] RegisteredTargets
Returns an array of all currently registered targets


Public Methods

void RegisterTarget(Transform t)
Registers the given Transform as a target

bool UnregisterTarget(Transform t)
Unregisters the target which is associated with the given Transform

void ClearTargets()
Unregisters all targets

float GetVariable(string name)
Returns the value of the global variable with the given name - 0.0f if the variable does not exist

void RegisterVariableFunction(string varName,
                              VariableResolver resolver)

Registers a function that will be used to resolve a global variable with the given name which can be used in DanmakuJSON-Terms

void SetVariable(string varName, float value)
Sets the value of the global variable with the given name which can be used in DanmakuJSON-Terms
Buy the Danmaku Engine plugin

Leave a comment