1.添加粒子库,放在项目同级目录下(必须!!必须!!)

egret之粒子系统

2.添加路径:

egret之粒子系统

3.添加代码:

    private creatParticle(_pname: string, _target, _x: number, _y: number) {
        if (_target != null) {
            let texture = RES.getRes(_pname + "_png");
            let config = RES.getRes(_pname + "_json");
   
            var _particle = new particle.GravityParticleSystem(texture, config);
            _particle.touchEnabled = false;
            _target.addChild(_particle);

            _particle.x = _x;
            _particle.y = _y;
            _particle.start()
            return _particle;
        } else {
            console.log("装载容器不存在");
        }
    }

 

相关文章:

  • 2021-07-20
  • 2022-01-19
  • 2021-08-02
  • 2022-01-06
  • 2021-08-17
猜你喜欢
  • 2021-04-25
  • 2022-12-23
  • 2021-10-03
  • 2021-10-07
  • 2022-12-23
  • 2021-04-03
相关资源
相似解决方案