'OnParticleCollision ' 在 webgl 构建中不起作用
'OnParticleCollision ' does not work in webgl build
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
似乎没有 运行.
你知道原因吗?你能帮我修一下吗?
我明白了。
- 在
Collision
中增加Collision Quality
,不要忘记将模式设置为world
和3d
。
原因是here:
Collision Quality:
This affects how “watertight” the collisions are - at lower quality levels, particles may sometimes pass through colliders (World mode only).
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
似乎没有 运行.
你知道原因吗?你能帮我修一下吗?
我明白了。
- 在
Collision
中增加Collision Quality
,不要忘记将模式设置为world
和3d
。
原因是here:
Collision Quality:
This affects how “watertight” the collisions are - at lower quality levels, particles may sometimes pass through colliders (World mode only).