'OnParticleCollision'在webgl构建中不起作用

时间:2016-03-30 02:19:35

标签: c# unity3d unity5 particle-system unity-webgl

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

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

你知道原因吗?你能帮我解决一下吗?

1 个答案:

答案 0 :(得分:0)

我明白了。

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

enter image description here

原因是here

  

碰撞质量:
  这会影响碰撞的“水密性” - 在质量较低的情况下,粒子有时会穿过碰撞器(仅限世界模式)。