_Particle

粒子类,功能包括粒子的创建、设置、更新、渲染等相关操作。 全部展开

只读属性展开

  • + param : _ParticleParam

    获得这个粒子特效创建时所使用的 _ParticleParam

静态属性展开

  • + Affector : uint

    枚举值,染色特效类型。

  • + Axis : uint

    枚举值,坐标系特效类型。

  • + AxisBillboard : uint

    枚举值,锁定轴向的图片特效类型。

    • 示例

       local pfxType = _Particle.AxisBillboard 
  • + Billboard : uint

    枚举值,垂直摄像机镜头焦点连线的图片特效类型。

  • + Chain : uint

    枚举值,链接图片特效类型,与ChainHelper类型匹配使用。

  • + ChainHelper : uint

    枚举值,链接辅助特效类型,与Chain类型匹配使用。

    • 示例

       local pfxType = _Particle.ChainHelper
  • + Dissolve : uint

    枚举值,溶解特效类型。

  • + DissolveTexture :uint

    枚举值,溶解模型贴图特效类型

    • 示例

       local pfxType = _Particle.DissolveTexture 
  • + Dummy : uint

    枚举值,空特效类型。

  • + Line : uint

    枚举值,线特效类型。

  • + Mesh : uint

    枚举值,模型特效类型。

  • + Point : uint

    枚举值,点特效类型。

  • + Quadangle : uint

    枚举值,可旋转图片特效类型。

  • + Rectangle2D :uint

    枚举值,2D矩形特效类型

    • 示例

       local pfxType = _Particle.Rectangle2D 
  • + TerrainDecal : uint

    枚举值,贴地表图片特效类型。

    • 示例

       local pfxType = _Particle.TerrainDecal 
  • + Track : uint

    枚举值,轨迹图片特效类型,与TrackHelper类型匹配使用。

  • + TrackHelper : uint

    枚举值,轨迹辅助特效类型,与Track类型匹配使用。

    • 示例

       local pfxType = _Particle.TrackHelper 
  • + Triangle : uint

    枚举值,三角形图片特效类型。

  • + UserDefined :uint

    枚举值,自定义特效类型

    • 示例

       local pfxType = _Particle.UserDefined
  • + WorldBillboard : uint

    枚举值,朝向摄像机镜头图片特效类型。

    • 示例

       local pfxType = _Particle.WorldBillboard 

属性展开

  • + bind : bool

    绑定属性。

    • 示例

       pfx.bind = true
  • + blender : _Blender

    设置一个绑定到特效的_Blender

  • + isNoFog : bool

    特效不受雾。

    • 示例

       pfx.isNoFog = true
  • + keepInPlayer : bool

    特效播放结束后是否保留在ParticlePlayer的列表中。

    • 示例

       pfx.keepInPlayer = true
  • + name : string

    逻辑名。

    • 示例

       pfx.name = 'hit'
  • + resname : string

    资源文件名,修改会导致加载新的资源。

    • 示例

       pfx.resame = 'hit.pfx'
  • + transform : _Matrix3D

    播放矩阵。

    • 示例

       local pfxPlayer = _ParticlePlayer.new()
      pfxPlayer:play(pfx.resname, pfx.transform)

构造方法展开

  • + function _Particle() : _Particle

    创建特效。

公共方法展开

  • + function addEmitter() : _ParticleEmitter

    创建发射器。

    • 返回
    • 创建的发射器对象。
    • 示例

       local emitter = pfx:addEmitter()
  • + function cache( )

    创建粒子缓存。

    • 示例

       pfx:cache()
  • + function clearEmitters()

    删除所有的Emitter。

    • 示例

       pfx:clearEmitters()  
  • + function delEmitter(emitter : _ParticleEmitter)

    删除发射器。

    • 参数
    • emitter的id或名字。

    • 示例

       pfx:delEmitter(emitter)  
  • + function getEmitter(name/id) : _ParticleEmitter

    返回指定的Emitter

    • 参数
    • 指定emitter的名字或id。

    • 示例

      local pe = pfx:getEmitter(emitter.name)  
  • + function getEmitters() : _array

    返回所有发射器列表。

    • 示例

       local tb = {}
      tb = pfx:getEmitters()
  • + function import(filename : string, parent)

    从文件导入粒子。

    • 参数
    • filename : 资源文件。
    • parent : 作为导入pfx的父的emitter的id或名字。

    • 示例

       pfx:import('hit.pfx', 'p1')
  • + function reset()

    粒子重置。

    • 示例

       pfx:reset()
  • + function save(filename : string)

    保存粒子。

    • 参数
    • filename : 粒子资源的文件名。

    • 示例

       pfx:save('hit.pfx')
  • + function set(pfx : _Particle)

    设置成目标粒子。

    • 参数
    • pfx : 粒子对象。

    • 示例

       pfx:set('hit.pfx')
  • + function stop()

    停止播放。

    • 示例

       pfx:stop()
问题反馈(登录才可以发表哦!)