Skip to content

Commit

Permalink
修正debug shader找不到的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
KumoKyaku committed Feb 6, 2024
1 parent 4049e5b commit 6650284
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ namespace Megumin
{
public class DebugLineUtility
{
public static readonly Material Material = new Material(Shader.Find("Unlit/Color"));
public static readonly Material MeshMaterial = new Material(Shader.Find("Universal Render Pipeline/Unlit"));

public static readonly Shader UnlitColor = Shader.Find("Unlit/Color");
public static readonly Shader URPUnlit = Shader.Find("Universal Render Pipeline/Unlit");
public static readonly Material Material = new Material(UnlitColor);
public static readonly Material MeshMaterial = new Material(URPUnlit ?? UnlitColor);

static DebugLineUtility()
{
Material.color = Color.red;
Expand All @@ -26,7 +28,9 @@ static DebugLineUtility()
MeshMaterial.SetOverrideTag("RenderType", "Transparent");
MeshMaterial.renderQueue = 3000;

MeshMaterial.SetColor("_BaseColor", new Color(1, 0, 0, 0.5f));
Color debugColor = new Color(1, 0, 0, 0.5f);
MeshMaterial.color = debugColor;
MeshMaterial.SetColor("_BaseColor", debugColor);
//无法从包加载
//var mat = Resources.Load<Material>("New Material.mat");
}
Expand Down

0 comments on commit 6650284

Please sign in to comment.