2016-03-30 13 views
0
using UnityEngine; 
using System.Collections; 

public class ParticleSystemCollisionManager : MonoBehaviour { 

    void OnParticleCollision(GameObject other) { 
     // work on pc build, webplayer build 
     //when switch to webgl build, it work in editor 
     //but after building, run webgl build in browser, it does not work 

     Debug.Log("Collision on " + other.name); 
     Destroy(this.gameObject); 
    } 
} 

工作,我建立一个游戏TMS'OnParticleCollision' 不存在的WebGL构建

它工作在PC/web playter。它在编辑器(webgl构建设置)中也起作用。但是在我将它构建到webgl后,它不起作用。看来OnParticleCollision没有运行。

你知道原因吗?你能帮我修好吗?

回答

0

我明白了。

  • 增加Collision QualityCollision,不要忘记将模式设置为world3d

enter image description here

,原因是here

碰撞质量:
这会影响“防水”的碰撞是 - 在较低的质量水平,颗粒有时通过对撞机(世界模式)。