Skip to content

Commit

Permalink
fix doublesided import when shader already had that set explicitly to…
Browse files Browse the repository at this point in the history
… false
  • Loading branch information
hybridherbst committed Apr 6, 2023
1 parent d9453ae commit 1843e14
Showing 1 changed file with 7 additions and 4 deletions.
Expand Up @@ -79,10 +79,13 @@ public override void OnImportAsset(AssetImportContext ctx)
// .Replace("\"m_RenderFace\": 1", "\"m_RenderFace\": 0");

// for 2020+
if (forceDoublesided && !graphData.Contains("m_TwoSided"))
graphData = graphData
.Replace("\"m_SurfaceType\": 0", "\"m_SurfaceType\": 0" + ",\n" + "\"m_TwoSided\": true")
.Replace("\"m_SurfaceType\": 1", "\"m_SurfaceType\": 1" + ",\n" + "\"m_TwoSided\": true");
if (forceDoublesided)
if (!graphData.Contains("m_TwoSided"))
graphData = graphData
.Replace("\"m_SurfaceType\": 0", "\"m_SurfaceType\": 0" + ",\n" + "\"m_TwoSided\": true")
.Replace("\"m_SurfaceType\": 1", "\"m_SurfaceType\": 1" + ",\n" + "\"m_TwoSided\": true");
else
graphData = graphData.Replace("\"m_TwoSided\": false", "\"m_TwoSided\": true");

if (hideShader)
graphData = graphData.Replace("\"m_Path\": \"", "\"m_Path\": \"Hidden/");
Expand Down

0 comments on commit 1843e14

Please sign in to comment.