using System; namespace UnityEngine.Rendering.Universal { /// /// Class containing shader and texture resources needed in URP. /// /// /// public class UniversalRenderPipelineEditorResources : ScriptableObject { /// /// Class containing shader resources used in URP. /// [Serializable, ReloadGroup] public sealed class ShaderResources { /// /// Autodesk Interactive ShaderGraph shader. /// [Reload("Shaders/AutodeskInteractive/AutodeskInteractive.shadergraph")] public Shader autodeskInteractivePS; /// /// Autodesk Interactive Transparent ShaderGraph shader. /// [Reload("Shaders/AutodeskInteractive/AutodeskInteractiveTransparent.shadergraph")] public Shader autodeskInteractiveTransparentPS; /// /// Autodesk Interactive Masked ShaderGraph shader. /// [Reload("Shaders/AutodeskInteractive/AutodeskInteractiveMasked.shadergraph")] public Shader autodeskInteractiveMaskedPS; /// /// Terrain Detail Lit shader. /// [Reload("Shaders/Terrain/TerrainDetailLit.shader")] public Shader terrainDetailLitPS; /// /// Terrain Detail Grass shader. /// [Reload("Shaders/Terrain/WavingGrass.shader")] public Shader terrainDetailGrassPS; /// /// Waving Grass Billboard shader. /// [Reload("Shaders/Terrain/WavingGrassBillboard.shader")] public Shader terrainDetailGrassBillboardPS; /// /// SpeedTree7 shader. /// [Reload("Shaders/Nature/SpeedTree7.shader")] public Shader defaultSpeedTree7PS; /// /// SpeedTree8 ShaderGraph shader. /// [Reload("Shaders/Nature/SpeedTree8_PBRLit.shadergraph")] public Shader defaultSpeedTree8PS; } /// /// Class containing material resources used in URP. /// [Serializable, ReloadGroup] public sealed class MaterialResources { /// /// Lit material. /// [Reload("Runtime/Materials/Lit.mat")] public Material lit; // particleLit is the URP default material for new particle systems. // ParticlesUnlit.mat is closest match to the built-in shader. // This is correct (current 22.2) despite the Lit/Unlit naming conflict. /// /// Particle Lit material. /// [Reload("Runtime/Materials/ParticlesUnlit.mat")] public Material particleLit; /// /// Terrain Lit material. /// [Reload("Runtime/Materials/TerrainLit.mat")] public Material terrainLit; /// /// Decal material. /// [Reload("Runtime/Materials/Decal.mat")] public Material decal; } /// /// Shader resources used in URP. /// public ShaderResources shaders; /// /// Material resources used in URP. /// public MaterialResources materials; } #if UNITY_EDITOR [UnityEditor.CustomEditor(typeof(UniversalRenderPipelineEditorResources), true)] class UniversalRenderPipelineEditorResourcesEditor : UnityEditor.Editor { /// public override void OnInspectorGUI() { DrawDefaultInspector(); // Add a "Reload All" button in inspector when we are in developer's mode if (UnityEditor.EditorPrefs.GetBool("DeveloperMode") && GUILayout.Button("Reload All")) { var resources = target as UniversalRenderPipelineEditorResources; resources.materials = null; resources.shaders = null; ResourceReloader.ReloadAllNullIn(target, UniversalRenderPipelineAsset.packagePath); } } } #endif }