'How can I check if package is installed in the project

I'm creating a module that looks for a text field in scene. if TextMeshPro is installed it looks for it, and if not, look for regular textfield/text mesh

the question is: how can I condition (pseudo code)

if(textMeshProExists)
    Look for A
else
    Look for B


Solution 1:[1]

a asmdef file can help this.

asmdef

Add one Version Defines, PACKAGE_ADDRESSABLES.

you can use it in your code.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Young40