Updated OutlineScope;
Reorgnize shader code;
This commit is contained in:
@@ -42,21 +42,6 @@ namespace Misaki.HdrpToon.Editor
|
||||
|
||||
protected override GUIContent Header => EditorGUIUtility.TrTextContent("Surface Options");
|
||||
|
||||
public static ShadingMode GetShadingMode()
|
||||
{
|
||||
return (ShadingMode)Properties.shadingMode.floatValue;
|
||||
}
|
||||
|
||||
public static PBRMode GetPBRMode()
|
||||
{
|
||||
return (PBRMode)Properties.pbrMode.floatValue;
|
||||
}
|
||||
|
||||
public static bool HasFeature(SurfaceFeatureFlags feature)
|
||||
{
|
||||
return ((SurfaceFeatureFlags)Properties.surfaceFeatures.floatValue & feature) != 0;
|
||||
}
|
||||
|
||||
public override void LoadMaterialProperties()
|
||||
{
|
||||
Properties.transparentMode = FindProperty("_TransparentEnabled");
|
||||
@@ -100,17 +85,7 @@ namespace Misaki.HdrpToon.Editor
|
||||
}
|
||||
}
|
||||
|
||||
var surfaceFeatures = (SurfaceFeatureFlags)Properties.surfaceFeatures.floatValue;
|
||||
EditorGUI.BeginChangeCheck();
|
||||
surfaceFeatures = (SurfaceFeatureFlags)EditorGUILayout.EnumFlagsField(Styles.surfaceFeaturesText, surfaceFeatures);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
Properties.surfaceFeatures.floatValue = (float)surfaceFeatures;
|
||||
foreach (var material in editor.GetMaterials())
|
||||
{
|
||||
material.SetShaderPassEnabled(UtsShaderPassName.OUTLINE_PASS_NAME, HasFeature(SurfaceFeatureFlags.Outline));
|
||||
}
|
||||
}
|
||||
editor.ShaderProperty(Properties.surfaceFeatures, Styles.surfaceFeaturesText);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user