A tool for the Unity DOTween plugin (by Demigiant), allowing you to easily create complex effects without coding anything.
Let's create interesting DOTween effects ! You can build all the available tweens and set the parameters as you like.
Everything takes place in a single Monobehaviour, directly in the inspector.
Almost every parameter has two ways to set its value : the first is the default way of setting a variable in the inspector. The second is through a dedicated ScriptableObject that will hold the value. For more information, see the dedicated section.
When you want to create a new tween effect simply add the component DOTweenBuilder on one of your GameObjects :
To add a new effect, click the "New" button and select the one you desire. Once selected, a new entry will be created in the list and you can tweak its settings as you need :
You will then need a reference to this DOTweenBuilder and call its Play() method :
You can add this tool to your project by downloading the unity package file in the release section or by cloning the repository in your project.
You (obviously) need to have DOTween installed in your project. If you don't, make sure to install it before you import this repository.
The simplest solution is to download the .unitypackage file that is in the release section.
You can also clone the project anywhere you want in your Unity project. The url for the git clone command is the following : https://github.com/AymNAym/DOTweenBuilder.git
If you want to go for the zip file method, simply download the project as a zip file, unzip it and add the DOTweenBuilder folder in your project. It can be added anywhere, as long as it is in the Assets folder.
The DOTween Builder system is strongly dependant on its folder hierachy. You can move the main folder anywhere you want in your project, but do not change its internal structure.
When you call the Play() method you basically create a new Sequence and you populate it with the tweens you set up. It means that once you called the Play() method, any setting changed will not be taken into account unless you recall the Play() method.
Mostly every parameter is tagged with a Tooltip attribute to help you understand its goal.
Most of the settings of this component are straightforward, except maybe the Play Conflict Strategy : this setting determines how the builder will behave if you call the Play() method while a current sequence is still playing.
Each existing element has a combination of common and unique settings. If you are not sure what a setting does, refer yourself to the official DOTween documentation : https://dotween.demigiant.com/documentation.php
You may have notice this symbol on the left of many variables :
This means that this value can be set in two different ways. The first is the default way to tweak a value in the inspector, and the second one is through a dedicated scriptable object :
The Scriptable Object is just a very simple object that only contains one field of the type of the variable. In the example just above, the Scriptable Object contains one field of type Transform :
This allow you to reference this Scriptable Object in another script, and modify the value in it as you wish. The next time you will call the Play() method of this DOTweenBuilder, the new value will be used. For example, this can be usefull
when you want to disable/enable a specific tween depending on runtime conditions :
Important : In the editor, when exiting playmode, the Scriptable Object will automatically reset its value to the value it had when entering playmode. This mimic the behaviour of a Scriptable Object in a final build.
If you need, you can create a custom element that you will be able to use as a DOTweenBuilder element. Navigate to the DOTweenBuilder folder :
When you click the "Add New" button on a DOTweenBuilder component, it actually looks into this folder and uses the folder names to build the context menu that you see. Each script in every folder then populates the related context menu element :
So, let's say you want to create a new element for a custom type named "MyCustomType". You need to create a new folder in the DOTweenBuilder folder that will contains the script for your custom element :
You then need to create the script that will be usable as a DOTweenBuilder element. The naming convention for this kind of script is DOTween{YOUR-EFFECT-NAME} :
This script needs to derive from DOTweenGenericElement<,>. This is a generic type that takes two arguments : the first one is the type of your target, and the second one is the type of the value you want to tween. In our example
the first parameter is MyCustomType, which contains a public float "valueToTween". Our second parameter is then float :
As you see, the compilator gives you an error. Thats because you need to implement the asbtract method "Generate()" that will contains the tweening logic. This method returns a Tween object :
You can then write the logic you want for your element, using the DOTween methods :
Last but not least, you need to add the [Serializable] tag to your class :
At this point you can use this component in any DOTweenBuilder :
Note that you can add serialized properties in your custom element :
And if you want your settings to be swappable with a dedicated Scriptable Object (as seen in the previous section), you need to use the DOTweenVariable objects :























