浏览代码

Fixes for decimal issues. comma and period could be wrong / different on different machines, this should now have been fixed

/main
Martin Thorzen 7 年前
当前提交
3d65bbd2
共有 2 个文件被更改,包括 2 次插入6 次删除
  1. 2
      com.unity.shadergraph/Editor/Data/Graphs/DynamicVectorMaterialSlot.cs
  2. 6
      com.unity.shadergraph/Editor/Data/Implementation/NodeUtils.cs

2
com.unity.shadergraph/Editor/Data/Graphs/DynamicVectorMaterialSlot.cs


if (channelCount == 1)
return values;
for (var i = 1; i < channelCount; i++)
values += ", " + value[i];
values += ", " + NodeUtils.FloatToShaderValue(value[i]);
return string.Format("{0}{1}({2})", precision, channelCount, values);
}

6
com.unity.shadergraph/Editor/Data/Implementation/NodeUtils.cs


return "NAN";
else
{
decimal amount;
if( decimal.TryParse(value.ToString(), NumberStyles.Any, CultureInfo.InvariantCulture, out amount) )
return amount.ToString();
else
return value.ToString();
return value.ToString(CultureInfo.InvariantCulture);
}
}
}
正在加载...
取消
保存