You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

29 lines
1.3 KiB

using System;
using System.Reflection;
using UnityEngine;
using UnityEditor.UIElements;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing;
using UnityEditor.Graphing.Util;
using UnityEditor.ShaderGraph.Internal;
using UnityEngine.UIElements;
namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers
{
[SGPropertyDrawer(typeof(SampleTexture2DNode))]
class SampleTexture2DNodePropertyDrawer : AbstractMaterialNodePropertyDrawer
{
internal override void AddCustomNodeProperties(VisualElement parentElement, AbstractMaterialNode nodeBase, Action setNodesAsDirtyCallback, Action updateNodeViewsCallback)
{
var node = nodeBase as SampleTexture2DNode;
PropertyDrawerUtils.AddCustomCheckboxProperty(
parentElement, nodeBase, setNodesAsDirtyCallback, updateNodeViewsCallback,
"Use Global Mip Bias", "Change Enable Global Mip Bias",
() => node.enableGlobalMipBias, (val) => node.enableGlobalMipBias = val);
PropertyDrawerUtils.AddCustomEnumProperty<Texture2DMipSamplingMode>(
parentElement, nodeBase, setNodesAsDirtyCallback, updateNodeViewsCallback,
"Mip Sampling Mode", "Change Mip Sampling Mode",
() => node.mipSamplingMode, (val) => node.mipSamplingMode = val);
}
}
}