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
没有运行。
答案 0 :(得分:0)
我明白了。
Collision Quality
中的Collision
,不要忘记将模式设置为world
和3d
。原因是here:
碰撞质量:
这会影响碰撞的“水密性” - 在质量较低的情况下,粒子有时会穿过碰撞器(仅限世界模式)。