bug fix
This commit is contained in:
+57
@@ -0,0 +1,57 @@
|
||||
#if !NO_INTERNALS_ACCESS
|
||||
#if UNITY_2021_3_OR_NEWER
|
||||
#define HAVE_CATEGORIES
|
||||
#endif
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityGLTF
|
||||
{
|
||||
// matches ShaderGraphLitGUI.cs
|
||||
public class PBRGraphUniversalGUI : PBRGraphGUI
|
||||
{
|
||||
#if HAVE_CATEGORIES
|
||||
private PropertyInfo materialEditorPropertyAccessor;
|
||||
private ShaderGraphLitGUI litGuiForwarder;
|
||||
|
||||
public override void ValidateMaterial(Material material)
|
||||
{
|
||||
if (material == null) throw new ArgumentNullException(nameof(material));
|
||||
|
||||
base.ValidateMaterial(material);
|
||||
|
||||
var automaticRenderQueue = GetAutomaticQueueControlSetting(material);
|
||||
BaseShaderGUI.UpdateMaterialSurfaceOptions(material, automaticRenderQueue);
|
||||
}
|
||||
|
||||
protected override void DrawSurfaceOptions(Material material)
|
||||
{
|
||||
if (material == null) throw new ArgumentNullException(nameof(material));
|
||||
|
||||
// Use default labelWidth
|
||||
EditorGUIUtility.labelWidth = 0f;
|
||||
|
||||
if (litGuiForwarder == null) litGuiForwarder = new ShaderGraphLitGUI();
|
||||
if (materialEditorPropertyAccessor == null) materialEditorPropertyAccessor = typeof(BaseShaderGUI).GetProperty("materialEditor", (BindingFlags) (-1));
|
||||
if (materialEditorPropertyAccessor != null) materialEditorPropertyAccessor.SetValue(litGuiForwarder, materialEditor); // forwarder.materialEditor = materialEditor;
|
||||
|
||||
litGuiForwarder.FindProperties(properties);
|
||||
litGuiForwarder.workflowMode = null;
|
||||
litGuiForwarder.DrawSurfaceOptions(material);
|
||||
}
|
||||
|
||||
protected override void DrawAdvancedOptions(Material material)
|
||||
{
|
||||
base.DrawAdvancedOptions(material);
|
||||
|
||||
materialEditor.DoubleSidedGIField();
|
||||
materialEditor.LightmapEmissionFlagsProperty(0, enabled: true, ignoreEmissionColor: true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 86a2b51891c425a468a0a4d61f8b2a6a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"reference": "GUID:c579267770062bf448e75eb160330b7f"
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd3b604407efbd641a4d40520de58a76
|
||||
AssemblyDefinitionReferenceImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user