【发布时间】:2016-06-28 01:44:54
【问题描述】:
我检查了文档,但没有发现如何更改我的粒子系统中的发射率,我检查了 Reddit 并没有发现任何东西。
我认为可以使用的代码是这样的:
public ParticleSystem Smoke;
void Start()
{
// Get the particle system (Smoke) Module.
em = Smoke.emission;
rate = em.rate;
// Set the Mode to Constant.
rate.mode = ParticleSystemCurveMode.Constant;
}
void Update()
{
if (distance < 1f)
{
// Attempt to set the constant
rate.constantMin = 20f;
rate.constantMax = 20f;
}
}
但是,当我在场景视图和检查器中查看我的 GameObjects Particle Systems Emission 时,使用上面的代码没有任何变化。我做错了什么?
【问题讨论】:
标签: c# unity3d particle-system