Update custom pass to global custom pass
This commit is contained in:
46
Runtime/HDRP/Models/UTSRenderPassSetting.cs
Normal file
46
Runtime/HDRP/Models/UTSRenderPassSetting.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Runtime/HDRP/Models/UTSRenderPassSetting.cs.meta
Normal file
2
Runtime/HDRP/Models/UTSRenderPassSetting.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d19dc5e91de57e46b4b146b129d4c87
|
||||
Reference in New Issue
Block a user