GitHub
7 年前
当前提交
fcd97941
共有 19 个文件被更改,包括 589 次插入 和 289 次删除
-
88MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Implementation/SerializableGraph.cs
-
8MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Interfaces/IGraph.cs
-
233MaterialGraphProject/Assets/PartyPreview.ShaderGraph
-
27MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/AbstractMaterialGraph.cs
-
27MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/SubGraph/LayeredShaderGraph.cs
-
63MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorView.cs
-
10MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs
-
11MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphPreviewGenerator.cs
-
2MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/NodeInspectors/BasicNodeInspector.cs
-
40MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/PreviewSystem.cs
-
227MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GraphEditorView.cs
-
7MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialNodeView.cs
-
4MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Shaders/Checkerboard.shader
-
42MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Styles/MaterialGraph.uss
-
2MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/ShaderGenerationTest.cs
-
53MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GradientEdge.cs
-
3MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GradientEdge.cs.meta
-
28MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/PreviewView.cs
-
3MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/PreviewView.cs.meta
233
MaterialGraphProject/Assets/PartyPreview.ShaderGraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
using UnityEditor.Experimental.UIElements.GraphView; |
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.UIElements.StyleSheets; |
|||
using UnityEngine.MaterialGraph; |
|||
|
|||
namespace UnityEditor.MaterialGraph.Drawing |
|||
{ |
|||
public class GradientEdge : Edge |
|||
{ |
|||
const string k_InputColorProperty = "edge-input-color"; |
|||
const string k_OutputColorProperty = "edge-output-color"; |
|||
|
|||
StyleValue<Color> m_InputColor; |
|||
StyleValue<Color> m_OutputColor; |
|||
|
|||
public Color inputColor |
|||
{ |
|||
get { return m_InputColor.GetSpecifiedValueOrDefault(defaultColor); } |
|||
} |
|||
|
|||
public Color outputColor |
|||
{ |
|||
get { return m_OutputColor.GetSpecifiedValueOrDefault(defaultColor); } |
|||
} |
|||
|
|||
public void UpdateClasses(ConcreteSlotValueType outputType, ConcreteSlotValueType inputType) |
|||
{ |
|||
ClearClassList(); |
|||
AddToClassList("edge"); |
|||
AddToClassList("from" + outputType); |
|||
AddToClassList("to" + inputType); |
|||
} |
|||
|
|||
protected override void OnStyleResolved(ICustomStyle styles) |
|||
{ |
|||
base.OnStyleResolved(styles); |
|||
styles.ApplyCustomProperty(k_InputColorProperty, ref m_InputColor); |
|||
styles.ApplyCustomProperty(k_OutputColorProperty, ref m_OutputColor); |
|||
} |
|||
|
|||
protected override void DrawEdge() |
|||
{ |
|||
if (!UpdateEdgeControl()) |
|||
return; |
|||
|
|||
edgeControl.edgeWidth = edgeWidth; |
|||
edgeControl.inputColor = isGhostEdge ? ghostColor : (selected ? selectedColor : inputColor); |
|||
edgeControl.outputColor = isGhostEdge ? ghostColor : (selected ? selectedColor : outputColor); |
|||
edgeControl.startCapColor = edgeControl.outputColor; |
|||
edgeControl.endCapColor = edgeControl.inputColor; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 161180898f1d444880080d666ab7be1d |
|||
timeCreated: 1509019463 |
|
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.UIElements; |
|||
using UnityEngine.Rendering; |
|||
|
|||
namespace UnityEditor.MaterialGraph.Drawing |
|||
{ |
|||
public sealed class PreviewView : VisualElement |
|||
{ |
|||
Texture m_Image; |
|||
|
|||
public Texture image |
|||
{ |
|||
get { return m_Image; } |
|||
set |
|||
{ |
|||
if (value == m_Image) |
|||
return; |
|||
m_Image = value; |
|||
Dirty(ChangeType.Repaint); |
|||
} |
|||
} |
|||
|
|||
public override void DoRepaint() |
|||
{ |
|||
EditorGUI.DrawPreviewTexture(contentRect, image); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 524b1aa8d68043cd81a6514d805eb50d |
|||
timeCreated: 1508917442 |
撰写
预览
正在加载...
取消
保存
Reference in new issue