Search Unity

Builds crash with Renderer2DData serialization error

Discussion in '2D Experimental Preview' started by steinbitglis, Jan 28, 2021.

  1. steinbitglis

    steinbitglis

    Joined:
    Sep 22, 2011
    Posts:
    219
    I'm not sure exactly what causes our crashes, but this is the first error message in the player log.

    We're using Unity 2020.2 and Universal RP 10.2.2
     
    GliderGuy likes this.
  2. steinbitglis

    steinbitglis

    Joined:
    Sep 22, 2011
    Posts:
    219
    Code (CSharp):
    1. namespace UnityEngine.Experimental.Rendering.Universal
    2. {
    3.     public partial class Renderer2DData
    4.     {
    5. #if UNITY_EDITOR
    6.         [SerializeField]
    7.         Renderer2DDefaultMaterialType m_DefaultMaterialType = Renderer2DDefaultMaterialType.Lit;
    8.  
    9.         [SerializeField, Reload("Runtime/Materials/Sprite-Lit-Default.mat")]
    10.         Material m_DefaultCustomMaterial = null;
    11.  
    12.         [SerializeField, Reload("Runtime/Materials/Sprite-Lit-Default.mat")]
    13.         Material m_DefaultLitMaterial = null;
    14.  
    15.         [SerializeField, Reload("Runtime/Materials/Sprite-Unlit-Default.mat")]
    16.         Material m_DefaultUnlitMaterial = null;
     
    GliderGuy likes this.
  3. GliderGuy

    GliderGuy

    Joined:
    Dec 14, 2018
    Posts:
    250
    I had this exact issue as well in (what I assumed) all 2020.2 Unity versions. :eek:
    After I upgraded to 2021.1b and Universal RP 11.x.x the issue went away. Hopefully they backport the fix to Universal RP 10.2.x (given that fixing the error should be trivial), but we shall see. :oops:
     
    steinbitglis likes this.
  4. steinbitglis

    steinbitglis

    Joined:
    Sep 22, 2011
    Posts:
    219
    I ended up investigating this for days. What I know is that it goes away if I change which packages are in use in my project, but I can remove almost everything else.
     
unityunity