Код: Выделить всё
private void FootBurningOfRabbit()
{
if (RabbitGroundControl())
{
if (rabbitGroundTimeCount >= rabbitGroundTime)
{
rabbitGroundTimeCount = 0f;
rabbitFreeze = true;
isRabbitDeath = true;
isRabbitDefinitelyDead = true;
}
else if (!isRabbitDeath)
{
Color myColor = myRenderer.color;
currentlyRabbitHealth = Mathf.Lerp(rabbitMaxHealth, rabbitMinHealth, rabbitGroundTimeCount / rabbitGroundTime);
myRenderer.color = Color.Lerp(myColor, deathColor, rabbitGroundTimeCount / rabbitGroundTime);
ParticleSystem.EmissionModule emission = myParticleSystem.emission;
emission.rateOverTime = new ParticleSystem.MinMaxCurve(100 - currentlyRabbitHealth);
rabbitGroundTimeCount += Time.deltaTime;
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... s-i-wanted