Class "DanmakuOrigin"

Namespace: VirtualDropkick.DanmakuEngine.Unity
Inherits from: UnityEngine.MonoBehaviour

Summary

The origin for bullet-patterns. Can be used for designing weapons of enemies/players or for any kind of spawner (enemies, power-ups, etc.)


Public Members

string contextName
The name of the context which is defined in the DanmakuController

DanmakuJSONFile bulletPattern
A reference to the default bullet pattern which will be used by this origin

DanmakuJSONFile[] bulletPatterns
An array of additional bullet patterns

bool startPatternAutomatically
Determines if the bullet pattern which is assigned to the bulletPattern-field will be started when this origin becomes active


Delegates

void ExecutionCallback(DanmakuOrigin origin)
Delegate for certain execution events of this origin


Events

ExecutionCallback OnInitialized
Gets fired when a new root-emitter gets initialized

ExecutionCallback OnBehaviourCycleFinished
Gets fired when the root-emitter of this origin has finished a behaviour-cycle

ExecutionCallback OnBehaviourFinished
Gets fired when the root-emitter of this origin has completely finished executing its behaviour


Public Properties

DanmakuJSONFile CurrentBulletPattern
The currently active bullet pattern. Note, that the return value is null, if no bullet pattern is currently active

DanmakuEmitter RootEmitter
The currently active root-emitter. Note, that the return value is null, if no bullet pattern is currently active

DanmakuContext Context
The context which this origin is associated with

bool IsRunningBulletPattern
Indicates if this origin currently has an active bullet pattern


Public Methods

void ResetRootEmitter()
Resets the root-emitter to the beginning of its defined behaviour

DanmakuEmitter StartBulletPattern(string name)
Starts the bullet pattern (which has to be present in the bulletPatterns-array) with the associated name and returns the newly created root-emitter. If a bullet pattern is already running, it will be stopped and the new one will be started

DanmakuEmitter StartBulletPattern()
Starts the bullet pattern which is assigned to the bulletPattern-field and returns the newly created root-emitter. If a bullet pattern is already running, it will be stopped and the new one will be started

DanmakuEmitter StartBulletPattern(int index)
Starts the bullet pattern with the given index in the bulletPatterns-array and returns the newly created root-emitter. If a bullet pattern is already running, it will be stopped and the new one will be started

DanmakuEmitter StartBulletPattern(DanmakuJSONFile pattern)
Starts the given bullet pattern and returns the newly created root-emitter. If a bullet pattern is already running, it will be stopped and the new one will be started

void DestroyRootEmitter()
Destroys the currently active root-emitter


Protected Methods

virtual void Start()
Called by Unity when this object becomes active. You can override this method in a sub-class but make sure that you call base.Start() to avoid breaking the behaviour of this class.


Buy the Danmaku Engine plugin

Leave a comment