var col = exhaust.colorOverLifetime; Gradient grad = new Gradient(); // 根据车辆损坏程度修改尾气深浅。损坏越大,颜色越深。 grad.SetKeys(new GradientColorKey[] { new GradientColorKey(Color.white, 0.0f), new GradientColorKey(new Color(214, 189, 151), 0.079f), new GradientColorKey(Color.white, 1.0f)}, new GradientAlphaKey[] { new GradientAlphaKey(0.0f, 0.0f), new GradientAlphaKey(damage / 255f + 10f / 255f, 0.061f), new GradientAlphaKey(0.0f, 1.0f) }); col.color = grad; } }