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;

posted on 2015-03-23 22:09  wantnon  阅读(593)  评论(0编辑  收藏  举报

导航