我的目标是根据水分计数数值使对象更饱和或更不饱和,但不知为何,颜色并没有实际上在我指定的材料中改变(材料是从Blender导入的,随着对象一起导入的)
public void hydrate(int hydration_change) // 使用负数来重新水分
{
hydration_count += hydration_change;
Color new_color = new Vector4(defaultR * Mathf.Pow(2, hydration_count), defaultG * Mathf.Pow(2, hydration_count), defaultB * Mathf.Pow(2, hydration_count), defaultA * Mathf.Pow(2, hydration_count));
crop_material.SetColor("new_color", new_color);
}
评论 (0)