メインコンテンツへスキップ

パーティクルエミッター

商品説明

このコンポーネントは、エンティティにパーティクルを放出させます。

プロパティ一覧

PropertyType初期値商品説明
停止ブーリアンfalseエミッターの再生状態
エミッターライフ番号0エミッターの寿命(秒
パーティクルパーショットinteger20排出あたりの粒子数
発光遅延番号0.1パーティクルが放出されるまでの時間
最低寿命番号1各パーティクルの最小寿命範囲
最大寿命番号1各パーティクルの最大寿命範囲
質量番号1各粒子の質量
重力番号0.2各粒子の重力係数
scale番号0.2各粒子の均一なスケール
フォースエックス番号5各粒子にX方向にかかる力
フォースワイ番号12各パーティクルにかかるY方向の力
フォースZ番号5各粒子にZ方向にかかる力
広がり番号360各パーティクルが原点に対して相対的にスポーンするエリアと方向
ラジアル速度番号5各粒子に適用される半径方向速度の量
スポーンエリアタイプストリングポイントサポートされているタイプは以下の通り: 点'、'箱'、'球'
スポーンエリア幅番号0スポーンエリアボックスの幅(ボックスのみ)
スポーンエリア高さ番号0スポーンエリアボックスの高さ(ボックスのみ)
スポーンエリアの深さ番号0スポーンエリア・ボックスの深さ(ボックスのみ)
スポーンエリア半径番号0スポーンエリア球体の半径(球体のみ)
boundingZoneTypeストリング'なし'サポートされているタイプは以下の通り: なし'、'ボックス'、'球'
バウンディングゾーン幅番号0バウンディングゾーンの幅(ボックスのみ)
バウンディングゾーン高さ番号0バウンディングゾーンの高さ(ボックスのみ)
バウンディングゾーンの深さ番号0バウンディングゾーンの深さ(ボックスのみ)
バウンディングゾーン半径番号0バウンディングゾーンの半径(球のみ)
リソースタイプストリングスプライトサポートされている型は以下の通り: スプライト」、「モデル
リソースURL文字列 (URL)''リソースのURL
ブレンドモードストリング'なし'サポートされるタイプは以下の通り: none」、「normal」、「add」、「multiply」、「subtract」。
アニメートカラーブーリアンfalse色をアニメーションさせるかどうかを決定する。
カラースタート文字列(16進数)未定義各パーティクルの開始色
カラーエンド文字列(16進数)未定義各パーティクルのエンディングカラー
ランダムドリフトブーリアンfalse各パーティクルのランダムドリフトを有効にする
ランダムドリフトレンジ番号未定義各パーティクルのランダムなドリフト範囲と速度を決定します。
衝突ブーリアンfalseパーティクルが物理衝突に反応するかどうかを決定する。

関数一覧

Get

Returns a read-only reference.

Example

ecs.ParticleEmitter.get(world, component.eid)

Set

Ensures the component exists on the entity, then assigns the (optional) data to the component.

Example

ecs.ParticleEmitter.set(world, component.eid, {
stopped: false,
emitterLife: 0,
particlesPerShot: 20,
emitDelay: 0.1,
minimumLifespan: 1,
maximumLifespan: 1,
mass: 1,
gravity: 0.2,
scale: 0.2,
forceX: 5,
forceY: 12,
forceZ: 5,
spread: 360
})

Mutate

Perform an update to the component within a callback function. Return true to indicate no changes made.

Example

ecs.ParticleEmitter.mutate(world, component.eid, (cursor) => {
cursor.emitDelay = 0.05;
cursor.particlesPerShot = 50;
return false;
})

Remove

Removes the component from the entity.

Example

ecs.ParticleEmitter.remove(world, component.eid)

Has

Returns true if the component is present on the entity.

Example

ecs.ParticleEmitter.has(world, component.eid)

Reset

Adds, or resets the component to its default state.

Example

ecs.ParticleEmitter.reset(world, component.eid)

Advanced Functions

Cursor

Returns a mutable reference. Cursors are reused so only one cursor for each component can exist at a time.

Example
ecs.ParticleEmitter.cursor(world, component.eid)

Acquire

Same behavior as cursor, but commit must be called after the cursor is done being used.

Example
ecs.ParticleEmitter.acquire(world, component.eid)

Commit

Called after acquire. An optional third argument determines whether the cursor was mutated or not.

Example
ecs.ParticleEmitter.commit(world, component.eid)
ecs.ParticleEmitter.commit(world, component.eid, false)

Dirty

Mark the entity as having been mutated. Only needed in a specific case where systems are mutating data.

Example
ecs.ParticleEmitter.dirty(world, component.eid)