unity c# script error CS0664: Literal of type double cannot be implicitly converted to type `float'. Add suffix `f' to create a literal of this type

例如在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;

原文地址:https://www.cnblogs.com/wantnon/p/4361175.html