浏览代码

Merge pull request #316 from Unity-Technologies/fix-for-decimal-issue

Fix for issues regarding decimals / periods
/main
GitHub 7 年前
当前提交
1536b7ef
共有 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);
}
}
}
正在加载...
取消
保存