add DOTWEEN_ASMDEF global marco
This PR is created to resolve the dependency issue when DOTween is an optional dependence of a package.
Because DOTween is not a package, a standard package can not directly use DOTween.
A common approach for a standard package to optionally depend on DOTween is:
-
in ASMDEF of the the package itself -
Assembly References, addDOTween.dll -
because DOTween has no
package.json, skip theVersion Defineshere -
use marco
DOTWEENto optionally execute logic with DoTween:#if DOTWEEN using DG.Tweening; // other logic #endif
Here using DG.Tweening; will failed when DOTween's ASMDEF has not been created yet, which requires user to manually create that.
Propose
This PR add DOTWEEN_ASMDEF when user created the ASMDEF of DOTween, and a standard package can now optionally depend on DOTween with the same approach, but change:
#if DOTWEEN
to
#if DOTWEEN_ASMDEF
This PR is created because the #586 has been pending for two years. This PR is much much more simple than 586. Though it does not directly resolve the package problem of DOTween, but it allows DOTween to be optionally dependent by other packages right away, with much less time to review the changes I've made