Changed the outline layer and hair shadow caster layer from LayerMask to RenderingLayerMask;
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
using System;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.Toonshader
|
||||
{
|
||||
[Serializable]
|
||||
public struct UTSOutlineSetting
|
||||
{
|
||||
public bool enable;
|
||||
public LayerMask layerMask;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct UtsHairShadowSetting
|
||||
{
|
||||
public bool enable;
|
||||
public LayerMask casterLayerMask;
|
||||
}
|
||||
|
||||
[CreateAssetMenu(fileName = "UTSRenderSetting", menuName = "UTS/RenderSetting")]
|
||||
public class UTSRenderPassSetting : ScriptableObject
|
||||
{
|
||||
public const string RENDERER_SETTING_ASSET_PATH = "Packages/com.misaki.hdrp-toon/Runtime/HDRP/Resources/UTSRenderSetting.asset";
|
||||
|
||||
public UTSOutlineSetting outlineSetting;
|
||||
public UtsHairShadowSetting hairShadowSetting;
|
||||
|
||||
internal static UTSRenderPassSetting GetOrCreateSettings()
|
||||
{
|
||||
var settings = AssetDatabase.LoadAssetAtPath<UTSRenderPassSetting>(RENDERER_SETTING_ASSET_PATH);
|
||||
if (settings == null)
|
||||
{
|
||||
settings = CreateInstance<UTSRenderPassSetting>();
|
||||
AssetDatabase.CreateAsset(settings, RENDERER_SETTING_ASSET_PATH);
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
|
||||
public static SerializedObject GetSerializedSettings()
|
||||
{
|
||||
return new(GetOrCreateSettings());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d19dc5e91de57e46b4b146b129d4c87
|
||||
63
Runtime/HDRP/Models/UTSRenderPassSettings.cs
Normal file
63
Runtime/HDRP/Models/UTSRenderPassSettings.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.Toonshader
|
||||
{
|
||||
[Serializable]
|
||||
public struct UTSOutlineSetting
|
||||
{
|
||||
public bool enable;
|
||||
public RenderingLayerMask renderingLayer;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct UtsHairShadowSetting
|
||||
{
|
||||
public bool enable;
|
||||
public RenderingLayerMask CasterRenderingLayer;
|
||||
}
|
||||
|
||||
[CreateAssetMenu(fileName = "UTSRenderSetting", menuName = "UTS/RenderSetting")]
|
||||
public class UTSRenderPassSettings : ScriptableObject
|
||||
{
|
||||
public const string UTS_RENDERING_SETTINGS_NAME = "UTSRenderingSettings";
|
||||
private const string UTS_Rendering_Settings_Path = "Packages/com.misaki.hdrp-toon/Runtime/HDRP/Resources/UTSRenderSettings.asset";
|
||||
|
||||
public UTSOutlineSetting outlineSetting;
|
||||
public UtsHairShadowSetting hairShadowSetting;
|
||||
|
||||
internal static UTSRenderPassSettings GetOrCreateSettings()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (EditorBuildSettings.TryGetConfigObject<UTSRenderPassSettings>(UTS_RENDERING_SETTINGS_NAME, out var settings))
|
||||
{
|
||||
return settings;
|
||||
}
|
||||
|
||||
UTSRenderPassSettings renderingSettings = null;
|
||||
if (File.Exists(UTS_Rendering_Settings_Path))
|
||||
{
|
||||
renderingSettings = AssetDatabase.LoadAssetAtPath<UTSRenderPassSettings>(UTS_Rendering_Settings_Path);
|
||||
}
|
||||
else
|
||||
{
|
||||
renderingSettings = CreateInstance<UTSRenderPassSettings>();
|
||||
AssetDatabase.CreateAsset(renderingSettings, UTS_Rendering_Settings_Path);
|
||||
}
|
||||
|
||||
EditorBuildSettings.AddConfigObject(UTS_RENDERING_SETTINGS_NAME, renderingSettings, false);
|
||||
|
||||
return renderingSettings;
|
||||
#else
|
||||
return Resources.Load<UTSRenderPassSettings>(Path.GetFileNameWithoutExtension(UTS_Rendering_Settings_Path));
|
||||
#endif
|
||||
}
|
||||
|
||||
public static SerializedObject GetSerializedSettings()
|
||||
{
|
||||
return new(GetOrCreateSettings());
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Runtime/HDRP/Models/UTSRenderPassSettings.cs.meta
Normal file
2
Runtime/HDRP/Models/UTSRenderPassSettings.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02a9f5e1730430c4090d73e427a7f7a3
|
||||
Reference in New Issue
Block a user