Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add DOTWEEN_ASMDEF global marco #686

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

TylerTemp
Copy link

@TylerTemp TylerTemp commented Jun 14, 2024

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:

  1. in ASMDEF of the the package itself - Assembly References, add DOTween.dll

    image

  2. because DOTween has no package.json, skip the Version Defines here

  3. use marco DOTWEEN to 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant