Demigiant / dotween

A Unity C# animation engine. HOTween v2
http://dotween.demigiant.com
Other
2.3k stars 346 forks source link

Build Instructions for 2022 #612

Open addie-lombardo opened 1 year ago

addie-lombardo commented 1 year ago

Hi! I've been working on a fork of DoTween to add the ability to tweet between gradients which was a lot easier and performant than the hack I was doing with the asset store version that could use up to 16 tweens.

I've gotten to the point where I've written a lot of theoretical code but actually need to build to test. I use Jetbrains Rider so I initially tried to build with that but got some errors when I imported the needed dlls into Unity so decided to move over to working in Visual Studio which the plugin appears to developed in to reduce any friction with building.

I haven't built a class library that targets the NET Standard 2.1 scripting runtime before (only 4.X) and while Rider appeared to be configured for when I opened the project, I don't know how to configure it for Visual Studio 2022. I've supposedly installed/enabled the 3.5 framework redistributable on my computer but I still get a warning to upgrade to the 4.8 framework. The web appears to be full of information on what the NET Standard 2.1 is and that it does support Unity but nowhere is there a tutorial for how to build for a situation like this. Unity's own documentation is focused on informing you on how to make plugins for 4.X while at the same time informing you that compatibility will be bad?? lol

Any sort of guidance would be massively appreciated and I would be happy once I figure things out to provide a guide with screenshots and etc for the wiki or elsewhere on how to setup the project as well as build for it. It would be massively helpful to know specifically how you build the project or would in the situation with the projects you've made open source!

Demigiant commented 1 year ago

Ahoy! And ahaha, sorry, I totally feel you: it can be complicated and I did set the repo up mostly to show the code without worrying of making it easy to build, and I keep using VS only for the libraries I have already setup while I go with Rider for everything else.

Just setting up the target framework to "Unity 3.5 .net Subset Base Class Libraries" should work tho? Where/when is the warning you get happening? Here's a screenshot of my Application properties for the main DOTween lib:

image

P.S. I don't know if it's similar to what you're doing with gradients, but in case you didn't notice there are shortcuts for gradients already (in separate files for UI/Sprites/Materials, here is the one for Materials: https://github.com/Demigiant/dotween/blob/develop/_DOTween.Assembly/bin/Modules/DOTweenModuleUnityVersion.cs#L49)