Skip to content

Commit

Permalink
Fix #344 (#348)
Browse files Browse the repository at this point in the history
* fix #344
* update version
  • Loading branch information
kerfuffles authored Apr 14, 2022
1 parent 2d3eab3 commit a3ccdb6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Plugins/API/Foundation/Editor/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
25 changes: 2 additions & 23 deletions Plugins/Editor/Scripts/Control/Helpers/MaterialUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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" ) )
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -290,7 +269,7 @@ internal static Material GetRuntimeMaterial( string materialName )
GenerateBuiltinPipelineMaterial( WindowMaterialName );
GenerateBuiltinPipelineMaterial( MetalMaterialName );

return Resources.Load<Material>( string.Format( "RealtimeCSG/Materials/{0}/{1}", GetRenderPipelineType(), materialName ) );
return Resources.Load<Material>( string.Format( "RealtimeCSG/Materials/{0}", materialName ) );
}

internal static PhysicMaterial GetRuntimePhysicMaterial(string materialName)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit a3ccdb6

Please sign in to comment.