浏览代码

Finilized Adder shader, fixed FunctionNInNOut issues

/main
Eduardo Chaves 8 年前
当前提交
337cd82b
共有 3 个文件被更改,包括 7 次插入7 次删除
  1. 6
      MaterialGraphProject/Assets/Eduardo/Editor/AddManyNodePresenter.cs
  2. 6
      MaterialGraphProject/Assets/Eduardo/FunctionNAddNode.cs
  3. 2
      MaterialGraphProject/Assets/Eduardo/FunctionNInNOut.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;

正在加载...
取消
保存