new ParticleSystem(param)
粒子系统对象构造函数。
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param |
object | 初始参数。
Properties
|
Members
-
groups :Array.<ParticleGroup>
-
获取粒子组
-
isParticleSystem :boolean
-
检查是否为粒子系统类型或继承自粒子系统类型
Methods
-
addGroup(group) → {ParticleGroup|undefined}
-
添加粒子组。
Parameters:
Name Type Description groupParticleGroup 粒子组。 Returns:
ParticleGroup | undefined - 返回添加的粒子组。Example
const group = new THING.ParticleGroup(); particleSystem.addGroup(group); -
getParticleData(param) → {object}
-
获取当前粒子系统的数据。
Parameters:
Name Type Description paramobject { dataVersion2:false } 当dataVersion2为true时,获取ThingJS 2.0的数据。 Returns:
object - 粒子系统的数据Example
const data = particleSystem.getParticleData({ dataVersion2:false }); -
removeGroup(group)
-
移除粒子组。
Parameters:
Name Type Description groupParticleGroup 粒子组。 Example
const groups = particleSystem.getGroups(); particleSystem.removeGroup(groups[0]);