NullReferenceException: Loaded <disc> material Ring is null
We get an inconsistent error in console when using a prefab containing shapes that is serialized into another game object's
[SerializeField] public GameObject ThisPrefabContainsShapes;
Later, this is instantiated with GameObject.Instantiate(ThisPrefabContainsShapes)
I've try to isolate this a few times into a simpler case, but haven't been able to reproduce the issue. This is in play mode in the editor. Hoping that this might ring a bell, if not I can try again to isolate into a clearer bug case.
Exceptions are thrown for each shape component (disc, line, ring) in the prefab, stating that their material's being null, such as:
NullReferenceException: Loaded disc material Ring is null
Shapes.ShapesMaterialUtils.GetDiscMaterial (Shapes.DiscType type) (at Assets/Asset Packs/Shapes/Scripts/Runtime/Utils/ShapesMaterialUtils.cs:113)
Shapes.Disc.GetMaterials () (at Assets/Asset Packs/Shapes/Scripts/Runtime/Components/Disc.cs:256)
Shapes.ShapeRenderer.UpdateMaterial () (at Assets/Asset Packs/Shapes/Scripts/Runtime/Components/ShapeRenderer.cs:131)
Shapes.ShapeRenderer.InitializeProperties () (at Assets/Asset Packs/Shapes/Scripts/Runtime/Components/ShapeRenderer.cs:210)
Shapes.ShapeRenderer.OnValidate () (at Assets/Asset Packs/Shapes/Scripts/Runtime/Components/ShapeRenderer.cs:48)
UnityEditor.AssetDatabase:LoadAssetAtPath(String)
Shapes.ShapesMaterials:InitMaterial(String, String, String[]) (at Assets/Asset Packs/Shapes/Scripts/Runtime/Utils/ShapesMaterials.cs:39)
Shapes.ShapesMaterials:.ctor(String, String[]) (at Assets/Asset Packs/Shapes/Scripts/Runtime/Utils/ShapesMaterials.cs:23)
Shapes.ShapesMaterialUtils:.cctor() (at Assets/Asset Packs/Shapes/Scripts/Runtime/Utils/ShapesMaterialUtils.cs:49)
Shapes.ShapeRenderer:OnValidate() (at Assets/Asset Packs/Shapes/Scripts/Runtime/Components/ShapeRenderer.cs:48)
this should now be fixed in 2.3.2!