浏览代码

Fix for system locales (#1593)

Fixed an issue that color property and vector in blackboard could still cause a system locale error.
/main
GitHub 6 年前
当前提交
d3224f75
共有 3 个文件被更改,包括 10 次插入8 次删除
  1. 1
      com.unity.shadergraph/CHANGELOG.md
  2. 8
      com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs
  3. 9
      com.unity.shadergraph/Editor/Data/Graphs/VectorShaderProperty.cs

1
com.unity.shadergraph/CHANGELOG.md


- Shader graphs using alpha clip now generate correct depth and shadow passes.
- `Normal Create` node has been renamed to `Normal From Texture`.
- The preview of nodes now updates correctly.
- Your system locale can no longer cause incorrect commands due to full stops being converted to commas.

8
com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs


result.Append("(\"");
result.Append(displayName);
result.Append("\", Color) = (");
result.Append(value.r);
result.Append(NodeUtils.FloatToShaderValue(value.r));
result.Append(value.g);
result.Append(NodeUtils.FloatToShaderValue(value.g));
result.Append(value.b);
result.Append(NodeUtils.FloatToShaderValue(value.b));
result.Append(value.a);
result.Append(NodeUtils.FloatToShaderValue(value.a));
result.Append(")");
return result.ToString();
}

9
com.unity.shadergraph/Editor/Data/Graphs/VectorShaderProperty.cs


using System;
using System.Text;
using UnityEditor.Graphing;
using UnityEngine;
namespace UnityEditor.ShaderGraph

result.Append("(\"");
result.Append(displayName);
result.Append("\", Vector) = (");
result.Append(value.x);
result.Append(NodeUtils.FloatToShaderValue(value.x));
result.Append(value.y);
result.Append(NodeUtils.FloatToShaderValue(value.y));
result.Append(value.z);
result.Append(NodeUtils.FloatToShaderValue(value.z));
result.Append(value.w);
result.Append(NodeUtils.FloatToShaderValue(value.w));
result.Append(")");
return result.ToString();
}
正在加载...
取消
保存