浏览代码

Merge branch 'hackweek2017' of https://github.com/stramit/MaterialGraph into hackweek2017

/main
bfogerty 7 年前
当前提交
cd52a1e3
共有 6 个文件被更改,包括 20 次插入8 次删除
  1. 6
      MaterialGraphProject/Assets/Eduardo/Editor/AddManyNodePresenter.cs
  2. 6
      MaterialGraphProject/Assets/Eduardo/FunctionNAddNode.cs
  3. 2
      MaterialGraphProject/Assets/Eduardo/FunctionNInNOut.cs
  4. 7
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/NodePreviewPresenter.cs
  5. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Interfaces/IMasterNode.cs
  6. 5
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/AbstractMasterNode.cs

6
MaterialGraphProject/Assets/Eduardo/Editor/AddManyNodePresenter.cs


if (addNode == null)
return;
if (GUILayout.Button("Add Slot"))
if (GUILayout.Button("Add Input"))
if (GUILayout.Button("Remove Slot"))
if (GUILayout.Button("Remove Input"))
{
addNode.RemoveInputSlot();
addNode.OnModified();

public override float GetHeight()
{
return EditorGUIUtility.singleLineHeight * 2 + 10 * EditorGUIUtility.standardVerticalSpacing;
return EditorGUIUtility.singleLineHeight * 2 + 3 * EditorGUIUtility.standardVerticalSpacing;
}
}

6
MaterialGraphProject/Assets/Eduardo/FunctionNAddNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Math/Advanced/AddMultiple")]
[Title("Math/Advanced/Adder")]
public class AddManyNode : FunctionNInNOut, IGeneratesFunction
{
int m_nodeInputCount = 2;

public AddManyNode()
{
name = "AddMany";
name = "Adder";
for(int i = 0; i < m_nodeInputCount; ++i)
{
AddInputSlot();

protected override string GetFunctionName()
{
return "unity_AddMultiple";
return "unity_Adder";
}
string GetSumOfAllInputs()

2
MaterialGraphProject/Assets/Eduardo/FunctionNInNOut.cs


{
int nextSlotId;
if (slotType == SlotType.Output)
nextSlotId = -GetOutputSlots<MaterialSlot>().Count() + 1;
nextSlotId = -( GetOutputSlots<MaterialSlot>().Count() + 1 );
else
nextSlotId = GetInputSlots<MaterialSlot>().Count() + 1;

7
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/NodePreviewPresenter.cs


List<PropertyGenerator.TextureInfo> defaultTextures;
var resultShader = ((IMasterNode) m_Node).GetFullShader(GenerationMode.Preview, out defaultTextures);
m_GeneratedShaderMode = PreviewMode.Preview3D;
if (((IMasterNode)m_Node).has3DPreview())
{
m_GeneratedShaderMode = PreviewMode.Preview3D;
}
return resultShader;
}
return ShaderGenerator.GeneratePreviewShader(m_Node, out m_GeneratedShaderMode);

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Interfaces/IMasterNode.cs


string GetSubShader(GenerationMode mode, PropertyGenerator shaderPropertiesVisitor);
string GetVariableNameForNode();
bool has3DPreview();
}
}

5
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/AbstractMasterNode.cs


public abstract string GetFullShader(GenerationMode mode, out List<PropertyGenerator.TextureInfo> configuredTextures);
public abstract string GetSubShader(GenerationMode mode, PropertyGenerator shaderPropertiesVisitor);
public virtual bool has3DPreview()
{
return true;
}
}
}
正在加载...
取消
保存