From a3ccdb6d13be59bd7f9a31dfebfd7cd47d3f872c Mon Sep 17 00:00:00 2001 From: Daniel Cornelius Date: Thu, 14 Apr 2022 18:04:15 -0500 Subject: [PATCH] Fix #344 (#348) * fix #344 * update version --- Plugins/API/Foundation/Editor/Version.cs | 2 +- .../Control/Helpers/MaterialUtility.cs | 25 ++----------------- package.json | 2 +- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/Plugins/API/Foundation/Editor/Version.cs b/Plugins/API/Foundation/Editor/Version.cs index 05d269d..d751947 100644 --- a/Plugins/API/Foundation/Editor/Version.cs +++ b/Plugins/API/Foundation/Editor/Version.cs @@ -2,7 +2,7 @@ namespace RealtimeCSG.Foundation { internal static class Versioning { - public const string PluginVersion = "1_571"; + public const string PluginVersion = "1_572"; public const string PluginDLLVersion = "1_559"; } } \ No newline at end of file diff --git a/Plugins/Editor/Scripts/Control/Helpers/MaterialUtility.cs b/Plugins/Editor/Scripts/Control/Helpers/MaterialUtility.cs index ffa7143..6c0a12a 100644 --- a/Plugins/Editor/Scripts/Control/Helpers/MaterialUtility.cs +++ b/Plugins/Editor/Scripts/Control/Helpers/MaterialUtility.cs @@ -145,25 +145,6 @@ internal static bool EqualInternalMaterial(Material o, Material n) o.name == n.name; } - private static string GetRenderPipelineType() - { - if( GraphicsSettings.renderPipelineAsset == null ) - return string.Empty; // we are using built-in, so do nothing. - - string rpDefaultMatShader = GraphicsSettings.renderPipelineAsset.defaultMaterial.shader.name; - - if( rpDefaultMatShader.StartsWith( "HDRP" ) ) - return "HDRP"; - - if( rpDefaultMatShader.StartsWith( "LWRP" ) ) - return "LWRP"; - - if( rpDefaultMatShader.StartsWith( "URP" ) || rpDefaultMatShader.StartsWith( "Universal Render Pipeline" )) - return "URP"; - - return string.Empty; // default rp, do nothing. - } - private static bool TryGetShaderMainTex( Material material, out string mainTexTag ) { if( material.HasProperty( "_Diffuse" ) ) @@ -217,9 +198,7 @@ private static void GenerateBuiltinPipelineMaterial( string name ) return; } - string rpType = GetRenderPipelineType(); - - if( !string.IsNullOrEmpty( rpType ) ) // if we are using any RP + if( GraphicsSettings.renderPipelineAsset != null ) // if we are using any RP { AssetDatabase.StartAssetEditing(); @@ -290,7 +269,7 @@ internal static Material GetRuntimeMaterial( string materialName ) GenerateBuiltinPipelineMaterial( WindowMaterialName ); GenerateBuiltinPipelineMaterial( MetalMaterialName ); - return Resources.Load( string.Format( "RealtimeCSG/Materials/{0}/{1}", GetRenderPipelineType(), materialName ) ); + return Resources.Load( string.Format( "RealtimeCSG/Materials/{0}", materialName ) ); } internal static PhysicMaterial GetRuntimePhysicMaterial(string materialName) diff --git a/package.json b/package.json index 1add808..e6c6007 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.prenominal.realtimecsg", - "version": "1.57.1", + "version": "1.57.2", "description": "RealtimeCSG is a CSG level design tool, that allows you to intuitively and rapidly create levels. With its non-destructive workflow, you can easily adjust your levels at any time, and iterate with instant feedback.", "displayName": "RealtimeCSG", "unity": "2018.3",