Tim Cooper
9 年前
当前提交
70760866
共有 28 个文件被更改,包括 4166 次插入 和 297 次删除
-
6UnityProject/Assets/UnityShaderEditor/Editor/Source/BaseMaterialGraph.cs
-
5UnityProject/Assets/UnityShaderEditor/Editor/Source/Drawing/DrawableMaterialNode.cs
-
38UnityProject/Assets/UnityShaderEditor/Editor/Source/Drawing/NodeAnchor.cs
-
2UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/AbsoluteNode.cs
-
4UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/AddNode.cs
-
42UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/BaseMaterialNode.cs
-
8UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/BlendNode.cs
-
19UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/DotNode.cs
-
16UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/Function1Input.cs
-
14UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/Function2Input.cs
-
44UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/Function3Input.cs
-
4UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/LerpNode.cs
-
2UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/MultiplyNode.cs
-
2UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/NormalNode.cs
-
2UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/PixelShaderNode.cs
-
2UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/SlotValue.cs
-
2UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/SubtractNode.cs
-
2UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/ViewDirectionNode.cs
-
6UnityProject/Assets/UnityShaderEditor/Editor/Source/Util/ShaderGenerator.cs
-
178UnityProject/Assets/UnityShaderEditor/Graphs/FresnelSubGraph.ShaderSubGraph
-
988UnityProject/Assets/UnityShaderEditor/Graphs/GlowMud.ShaderGraph
-
993UnityProject/Assets/UnityShaderEditor/Graphs/LayeredTarp.ShaderGraph
-
992UnityProject/Assets/UnityShaderEditor/Graphs/SimpleGraph.ShaderGraph
-
980UnityProject/Assets/UnityShaderEditor/Graphs/SimpleMetal.ShaderGraph
-
30UnityProject/Assets/UnityShaderEditor/Editor/Source/Drawing/NodeOutputAnchor.cs
-
12UnityProject/Assets/UnityShaderEditor/Editor/Source/Drawing/NodeOutputAnchor.cs.meta
-
62UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/SplatNode.cs
-
8UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/SplatNode.cs.meta
988
UnityProject/Assets/UnityShaderEditor/Graphs/GlowMud.ShaderGraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
993
UnityProject/Assets/UnityShaderEditor/Graphs/LayeredTarp.ShaderGraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
992
UnityProject/Assets/UnityShaderEditor/Graphs/SimpleGraph.ShaderGraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
980
UnityProject/Assets/UnityShaderEditor/Graphs/SimpleMetal.ShaderGraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
using System; |
|||
using UnityEditor.Experimental; |
|||
using UnityEditor.Experimental.Graph; |
|||
using UnityEditor.Graphs; |
|||
using UnityEngine; |
|||
|
|||
namespace UnityEditor.MaterialGraph |
|||
{ |
|||
public class NodeOutputAnchor : NodeAnchor |
|||
{ |
|||
public NodeOutputAnchor(Vector3 position, Type type, Slot slot, MaterialGraphDataSource data) |
|||
: base(position, type, slot, data) |
|||
{ |
|||
m_Direction = Direction.eOutput; |
|||
} |
|||
|
|||
public override void Render(Rect parentRect, Canvas2D canvas) |
|||
{ |
|||
var anchorColor = Color.yellow; |
|||
anchorColor.a = 0.7f; |
|||
base.Render(parentRect, canvas); |
|||
EditorGUI.DrawRect(new Rect(translation.x, translation.y, scale.x, scale.y), anchorColor); |
|||
Vector2 sizeOfText = GUIStyle.none.CalcSize(new GUIContent(m_Type.Name)); |
|||
|
|||
Rect labelRect = new Rect(translation.x - sizeOfText.x - 4.0f, translation.y, sizeOfText.x + 4.0f, sizeOfText.y + 4.0f); |
|||
GUI.Label(labelRect, m_Slot.name); |
|||
} |
|||
|
|||
}; |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 7d206272c8dc0c942a9bf61ccf1310dd |
|||
timeCreated: 1445503903 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
|
|||
namespace UnityEditor.MaterialGraph |
|||
{ |
|||
[Title("Channels/Splat Node")] |
|||
class SplatNode : Function1Input |
|||
{ |
|||
[SerializeField] |
|||
private int m_SwizzleChannel; |
|||
|
|||
public override void OnCreate() |
|||
{ |
|||
base.OnCreate(); |
|||
name = "SplatNode"; |
|||
m_SwizzleChannel = 0; |
|||
} |
|||
|
|||
private string GetChannelFromConfiguration() |
|||
{ |
|||
switch (m_SwizzleChannel) |
|||
{ |
|||
case 0: |
|||
return "xxxx"; |
|||
case 1: |
|||
return "yyyy"; |
|||
case 2: |
|||
return "zzzz"; |
|||
default: |
|||
return "wwww"; |
|||
} |
|||
} |
|||
|
|||
public override float GetNodeUIHeight(float width) |
|||
{ |
|||
return EditorGUIUtility.singleLineHeight; |
|||
} |
|||
|
|||
public override bool NodeUI(Rect drawArea) |
|||
{ |
|||
base.NodeUI(drawArea); |
|||
string[] values = {"x", "y", "z", "w"}; |
|||
EditorGUI.BeginChangeCheck(); |
|||
m_SwizzleChannel = EditorGUI.Popup(new Rect(drawArea.x, drawArea.y, drawArea.width, EditorGUIUtility.singleLineHeight), "Channel", m_SwizzleChannel, values); |
|||
if (EditorGUI.EndChangeCheck()) |
|||
{ |
|||
RegeneratePreviewShaders(); |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
protected override string GetFunctionName() |
|||
{ |
|||
return ""; |
|||
} |
|||
|
|||
protected override string GetFunctionCallBody(string inputValue) |
|||
{ |
|||
return inputValue + "." + GetChannelFromConfiguration(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: c740b99e5a743e84d8030d697cc6d0a1 |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
撰写
预览
正在加载...
取消
保存
Reference in new issue