Matt Dean
7 年前
当前提交
78db5ef1
共有 11 个文件被更改,包括 79 次插入 和 179 次删除
-
72MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/FloatShaderProperty.cs
-
7MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Basic/IntegerNode.cs
-
13MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/Basic/SliderNode.cs
-
26MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Input/PropertyNode.cs
-
7MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Blackboard/BlackboardFieldPropertyView.cs
-
2MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorView.cs
-
8MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/ShaderPropertyView.cs
-
56MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/IntegerShaderProperty.cs
-
3MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/IntegerShaderProperty.cs.meta
-
61MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/SliderShaderProperty.cs
-
3MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/SliderShaderProperty.cs.meta
|
|||
using System; |
|||
using System.Text; |
|||
using UnityEditor.Graphing; |
|||
using UnityEngine; |
|||
|
|||
namespace UnityEditor.ShaderGraph |
|||
{ |
|||
[Serializable] |
|||
public class IntegerShaderProperty : AbstractShaderProperty<int> |
|||
{ |
|||
public IntegerShaderProperty() |
|||
{ |
|||
displayName = "Integer"; |
|||
} |
|||
|
|||
public override PropertyType propertyType |
|||
{ |
|||
get { return PropertyType.Float; } |
|||
} |
|||
|
|||
public override Vector4 defaultValue |
|||
{ |
|||
get { return new Vector4(value, value, value, value); } |
|||
} |
|||
|
|||
public override string GetPropertyBlockString() |
|||
{ |
|||
var result = new StringBuilder(); |
|||
result.Append(referenceName); |
|||
result.Append("(\""); |
|||
result.Append(displayName); |
|||
result.Append("\", Int) = "); |
|||
result.Append(value); |
|||
return result.ToString(); |
|||
} |
|||
|
|||
public override string GetPropertyDeclarationString(string delimiter = ";") |
|||
{ |
|||
return string.Format("float {0}{1}", referenceName, delimiter); |
|||
} |
|||
|
|||
public override PreviewProperty GetPreviewMaterialProperty() |
|||
{ |
|||
return new PreviewProperty(PropertyType.Float) |
|||
{ |
|||
name = referenceName, |
|||
floatValue = value |
|||
}; |
|||
} |
|||
|
|||
public override INode ToConcreteNode() |
|||
{ |
|||
return new IntegerNode { value = value }; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 5980fe29fe1b01c4fa3fb434dd9eb9e2 |
|||
timeCreated: 1505346922 |
|
|||
using System; |
|||
using System.Text; |
|||
using UnityEditor.Graphing; |
|||
using UnityEngine; |
|||
|
|||
namespace UnityEditor.ShaderGraph |
|||
{ |
|||
[Serializable] |
|||
public class SliderShaderProperty : AbstractShaderProperty<Vector3> |
|||
{ |
|||
public SliderShaderProperty() |
|||
{ |
|||
displayName = "Slider"; |
|||
value = new Vector3(0, 0, 1); |
|||
} |
|||
|
|||
public override PropertyType propertyType |
|||
{ |
|||
get { return PropertyType.Float; } |
|||
} |
|||
|
|||
public override Vector4 defaultValue |
|||
{ |
|||
get { return new Vector4(value.x, value.y, value.z, value.x); } |
|||
} |
|||
|
|||
public override string GetPropertyBlockString() |
|||
{ |
|||
var result = new StringBuilder(); |
|||
result.Append(referenceName); |
|||
result.Append("(\""); |
|||
result.Append(displayName); |
|||
result.Append("\", Range("); |
|||
result.Append(value.y); |
|||
result.Append(", "); |
|||
result.Append(value.z); |
|||
result.Append(")) = "); |
|||
result.Append(value.x); |
|||
return result.ToString(); |
|||
} |
|||
|
|||
public override string GetPropertyDeclarationString(string delimiter = ";") |
|||
{ |
|||
return string.Format("float {0}{1}", referenceName, delimiter); |
|||
} |
|||
|
|||
public override PreviewProperty GetPreviewMaterialProperty() |
|||
{ |
|||
return new PreviewProperty(PropertyType.Float) |
|||
{ |
|||
name = referenceName, |
|||
floatValue = value.x |
|||
}; |
|||
} |
|||
|
|||
public override INode ToConcreteNode() |
|||
{ |
|||
return new SliderNode { value = value }; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 116edc957722a90438d51cf6610694d3 |
|||
timeCreated: 1505346922 |
撰写
预览
正在加载...
取消
保存
Reference in new issue