浏览代码

Plug UnlitGraphUI to UnlitTemplate

/scriptablerenderloop-materialgraph
Paul Demeulenaere 8 年前
当前提交
592b2ca6
共有 6 个文件被更改,包括 69 次插入3 次删除
  1. 7
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Editor/LitGraphUI.cs
  2. 2
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.template
  3. 1
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/Editor/BaseUnlitUI.cs
  4. 2
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/Unlit.template
  5. 48
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/Editor/UnlitGraphUI.cs
  6. 12
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/Editor/UnlitGraphUI.cs.meta

7
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Editor/LitGraphUI.cs


using System;
using System.Linq;
namespace UnityEditor
namespace UnityEditor.Experimental.ScriptableRenderLoop
{
class LitGraphUI : BaseLitGUI
{

{
}
protected override bool ShouldEmissionBeEnabled(Material material)
{
return true;
}
}
}

2
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.template


ENDHLSL
}
}
CustomEditor "LitGraphUI"
CustomEditor "Experimental.ScriptableRenderLoop.LitGraphUI"
}

1
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/Editor/BaseUnlitUI.cs


protected const string kAlphaCutoff = "_AlphaCutoff";
protected const string kAlphaCutoffEnabled = "_AlphaCutoffEnable";
protected const string kDoubleSidedMode = "_DoubleSidedMode";
protected static string[] reservedProperties = new string[] { kSurfaceType, kBlendMode, kAlphaCutoff, kAlphaCutoffEnabled, kDoubleSidedMode };
protected MaterialEditor m_MaterialEditor;

2
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/Unlit.template


ENDHLSL
}
}
CustomEditor "Experimental.ScriptableRenderLoop.UnlitGraphUI"
}

48
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/Editor/UnlitGraphUI.cs


using UnityEngine;
using System;
using System.Linq;
namespace UnityEditor.Experimental.ScriptableRenderLoop
{
class UnlitGraphUI : BaseUnlitGUI
{
private MaterialProperty[] genericProperties = new MaterialProperty[] { };
protected override void FindInputProperties(MaterialProperty[] props)
{
genericProperties = props.Where(p => (p.flags & MaterialProperty.PropFlags.HideInInspector) == 0 & !reservedProperties.Contains(p.name)).ToArray();
}
protected override void FindInputOptionProperties(MaterialProperty[] props)
{
}
protected override void SetupInputMaterial(Material material)
{
}
protected override void ShaderInputGUI()
{
EditorGUI.indentLevel++;
foreach (var prop in genericProperties)
{
if ((prop.type & MaterialProperty.PropType.Texture) != 0)
{
m_MaterialEditor.TexturePropertySingleLine(new GUIContent(prop.name), prop);
}
else
{
m_MaterialEditor.ShaderProperty(prop, prop.name);
}
}
EditorGUI.indentLevel--;
}
protected override void ShaderInputOptionsGUI()
{
}
protected override bool ShouldEmissionBeEnabled(Material material)
{
return true;
}
}
}

12
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Unlit/Editor/UnlitGraphUI.cs.meta


fileFormatVersion: 2
guid: a34aea8c894f9f84b8a8743fa25f86f8
timeCreated: 1480424484
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存