【发布时间】:2021-09-21 01:39:11
【问题描述】:
当我从 p 获得双精度并想要转换为浮点时,我收到错误:错误 CS1503:参数 1:无法从“双精度”转换为“字符串”。当我查看 Masse(double) 的输出时,我得到数字 0(默认值);我现在不知道为什么
foreach (GameObject p in Planetss)
{
y = 0;
vertices[i] = new Vector3(x, y, z);
float distanz = Vector3.Distance(p.transform.position, vertices[i]);
double Masse = p.AddComponent<Value_Planet>().Masse1;
float FMasse = float.Parse(Masse);
【问题讨论】:
-
好吧
float.Parse不需要s double,而是string...
标签: unity3d double converters