Skip to content

Commit

Permalink
Fixed load of default wire rendering material from the resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmalg committed Feb 17, 2022
1 parent 641a4d0 commit e91d82e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions AGXUnity/Rendering/WireRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public Wire Wire
[AllowRecursiveEditing]
public Material Material
{
get { return m_material ?? DefaultMaterial(); }
get { return m_material == null ?
m_material = DefaultMaterial() :
m_material; }
set
{
m_material = value ?? DefaultMaterial();
Expand Down Expand Up @@ -157,7 +159,7 @@ private void OnSceneView( SceneView sceneView )

private static Material DefaultMaterial()
{
return Resources.Load<Material>( "Materials/WireMaterial_01.mat" );
return Resources.Load<Material>( "Materials/WireMaterial_01" );
}

private static Matrix4x4 CalculateCylinderTransform( Vector3 start, Vector3 end, float radius )
Expand Down

0 comments on commit e91d82e

Please sign in to comment.