表示テーマ
ParticleSystem
1つのEmitterとPhase列を持つParticleをCPUまたはGPUで実行します。
型の情報
- 名前空間:
NEMEngine - 型:
NEMEngine.ParticleSystem(Class) - 継承元:NEMEngine.Component
- Inspector:ParticleSystem
Clear
csharp
public void Clear(bool withChildren = true)発生済みの粒子を消去します。ParticleSystemの設定やGameObjectを削除する操作ではありません。
| 引数 | 型 | 既定値 |
|---|---|---|
withChildren | bool | True |
Enabled
csharp
public bool EnabledこのComponentの処理を有効にします。GameObject全体のアクティブ状態とは別です。
操作:読取・変更。
対応するInspector:ParticleSystem。
FromEntity
csharp
public static ParticleSystem FromEntity(GameObject gameObject)既にComponentを持つGameObjectから操作用の参照を作ります。Componentを追加する操作ではありません。
| 引数 | 型 | 既定値 |
|---|---|---|
gameObject | NEMEngine.GameObject | 必須 |
戻り値:NEMEngine.ParticleSystem。
GetSettings
csharp
public ParticleSystemSettings GetSettings()Emitter・Phase・Module・Trail・GPU設定を持つ編集用Snapshotを取得します。変更後はSetSettingsへ戻します。
戻り値:NEMEngine.ParticleSystemSettings。
IsAlive
csharp
public bool IsAlive(bool withChildren = true)発生や生存粒子が残っているかを調べます。isPlayingと異なり、停止後に残った粒子を含む終了判定へ使います。
| 引数 | 型 | 既定値 |
|---|---|---|
withChildren | bool | True |
戻り値:bool。
Layer
csharp
public int Layer描画するLayer番号です。
操作:読取・変更。
対応するInspector:ParticleSystem。
Order
csharp
public int Order同じLayer内の並び順です。
操作:読取・変更。
対応するInspector:ParticleSystem。
Pause
csharp
public void Pause(bool withChildren = true)粒子の再生状態を保持して一時停止します。消去とは異なり、Playで続きの再生へ戻せます。
| 引数 | 型 | 既定値 |
|---|---|---|
withChildren | bool | True |
Play
csharp
public void Play(bool withChildren = true)再生を開始または再開します。withChildrenで子のParticleSystemにも操作を伝えるかを選びます。
| 引数 | 型 | 既定値 |
|---|---|---|
withChildren | bool | True |
PlayOnAwake
csharp
public bool PlayOnAwake自動再生するかを指定するboolプロパティです。system.PlayOnAwake = true; と代入します。今再生する関数はPlay()で、このプロパティを関数として呼び出しません。
操作:読取・変更。
対応するInspector:ParticleSystem。
PlayOneShot
csharp
public void PlayOneShot(bool withChildren = true)演出を単発で再生します。繰り返す環境効果ではなく、攻撃・着弾などの一度の発生に使います。
| 引数 | 型 | 既定値 |
|---|---|---|
withChildren | bool | True |
PlaybackSpeed
csharp
public float PlaybackSpeed再生時間に掛ける倍率です。
操作:読取・変更。
対応するInspector:ParticleSystem。
RenderingLayerMask
csharp
public uint RenderingLayerMaskこのRendererを表示するCameraのCullingMaskと照合するbit集合です。
操作:読取・変更。
対応するInspector:ParticleSystem。
SetSettings
csharp
public void SetSettings(ParticleSystemSettings settings)編集済みSnapshotをこのParticleSystemへ反映します。GetSettingsの戻り値だけを書き換えて終了しないでください。
| 引数 | 型 | 既定値 |
|---|---|---|
settings | NEMEngine.ParticleSystemSettings | 必須 |
SimulationSpace
csharp
public ParticleSystemSimulationSpace SimulationSpace発生済み粒子をEmitterへ追従させるLocalか、Worldへ残すかを指定します。
操作:読取・変更。
対応するInspector:ParticleSystem。
SimulationTarget
csharp
public ParticleSimulationTarget SimulationTargetCPUまたはGPUを選びます。使用できるModuleと追加機能が変わります。
操作:読取・変更。
対応するInspector:ParticleSystem。
Stop
csharp
public void Stop(bool withChildren = true, ParticleSystemStopBehavior stopBehavior = StopEmitting)新規発生を止めます。stopBehaviorで発生済み粒子も消すかを選びます。withChildrenは子への伝播指定です。
| 引数 | 型 | 既定値 |
|---|---|---|
withChildren | bool | True |
stopBehavior | NEMEngine.ParticleSystemStopBehavior | 1 |
StopAction
csharp
public ParticleSystemStopAction StopAction粒子がなくなった後のGameObject無効化・破棄などを指定します。
操作:読取・変更。
対応するInspector:ParticleSystem。
UseUnscaledTime
csharp
public bool UseUnscaledTimeTimeScaleの影響を受けない時間で進めます。
操作:読取・変更。
対応するInspector:ParticleSystem。
Visible
csharp
public bool Visible通常描画に表示するかを指定します。
操作:読取・変更。
対応するInspector:ParticleSystem。
componentTypeID
csharp
public static int componentTypeID組み込みComponentの接続識別子です。通常のゲームコードではGetComponentで取得します。
操作:読取専用。
droppedTrailCount
csharp
public int droppedTrailCountTrailの容量上限などで保持できなかった軌跡の診断値です。
操作:読取専用。
hasValidStatistics
csharp
public bool hasValidStatistics粒子数・Trail数の統計が利用可能かを示す読取専用値です。GPUの読戻し待ちと0件を区別します。
操作:読取専用。
isEmitting
csharp
public bool isEmitting新しい粒子を発生させているかを取得します。
操作:読取専用。
isPaused
csharp
public bool isPausedParticleSystemが一時停止しているかを取得します。
操作:読取専用。
isPlaying
csharp
public bool isPlayingParticleSystemが再生状態かを取得します。
操作:読取専用。
isStopped
csharp
public bool isStoppedParticleSystemが停止状態かを取得します。
操作:読取専用。
particleCount
csharp
public int particleCount確認できる生存粒子数です。GPUではhasValidStatisticsを併せて確認します。
操作:読取専用。
randomSeed
csharp
public uint randomSeed固定再生に使う乱数Seedです。
操作:読取・変更。
対応するInspector:ParticleSystem。
trailCount
csharp
public int trailCount確認できるTrail数です。最大粒子数とは別の容量を使用します。
操作:読取専用。
useAutoRandomSeed
csharp
public bool useAutoRandomSeed再生のたびにSeedを変えます。無効なら指定Seedで再現します。
操作:読取・変更。
対応するInspector:ParticleSystem。
実行時の扱い
Nativeと接続する操作は、Scriptが実行される有効なWorld内で使用します。破棄したGameObjectやComponentへのアクセスは避けてください。設定Snapshotは取得・編集・反映を1組で扱います。