Search Unity

Assembly Definition Variants

Discussion in 'Editor & General Support' started by Piflik, Apr 10, 2019.

  1. Piflik

    Piflik

    Joined:
    Sep 11, 2011
    Posts:
    293
    I am currently trying to introduce Assembly Definitions into our central framework. This framework is used accross multiple projects. Recently, I implemented something into the framework that uses TextMesh Pro. Because I cannot guarantee that TMP exists in every project, I added a Compiler Directive to the code that disables the code if you don't need it.

    In order for the Assembly Definition File to work, I have to add a reference to the TMP dll so I can use the TMP functions. This works in my project, but when the assembly definition is included into a project without the TMP package, it produces a missing reference error.

    I saw that the assembly definition allow for constraints, so I put the same Compiler DIrective in there, but Unity doesn't allow me to put two different assembly definitions into a single folder, even though their constraints are exactly opposite.

    Is there something I can do to make that work, or do I just have to accept that I can only have either an assembly definition for the version with TMP or one for the version without?