Search Unity

Bug ProBuilder@5.0.0-pre.10 fails to build

Discussion in 'World Building' started by dgoyette, Feb 1, 2021.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    Reported as bug #1311278.

    It seems that between pre.7 and pre.10, a bunch of dependencies on UnityEditor classes were added to Runtime/Shapes classes. The result is that projects contain this version of ProBuilder cannot be built. The result seems to be having moved all the PropertyDrawer stuff directly into their related classes, without wrapping the UnityEditor stuff in precompile statements.

    For example:
    Code (CSharp):
    1. Library\PackageCache\com.unity.probuilder@5.0.0-pre.10\Runtime\Shapes\Cone.cs(123,31): error CS0246: The type or namespace name 'PropertyDrawer' could not be found (are you missing a using directive or an assembly reference?)
    2.  
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    FWIW, if anyone else is running into this, it's fairly easy to workaround. You'll need to copy the PB package over and reference it as a local package. Then editing the various Shape subclasses, and wrap the offending UnityEditor code in
    #ifdef UNITYEDITOR
    statements. Probably easier just to revert to the previous 'pre' release of PB, but I liked the fixed in .10 enough to not want to revert if I had an alternative.
     
  3. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    552
    dgoyette likes this.