例如在unity c# script中定义

private float x=0.0;

则会报 error CS0664: Literal of type double cannot be implicitly converted to type `float'. Add suffix `f' to create a literal of this type

应写成

float x=0.0f;

相关文章: