

Setter A delegate that sets the value of the property to tween. Where myValue is the name of the property to tween. Getter A delegate that returns the value of the property to tween. static DOTween.To(getter, setter, to, float duration) Changes the given property from its current value to the given one. Just chain a From to a Tweener to make the tween behave as a FROM tween instead of a TO tween. This is the most flexible way of tweening and allows you to tween almost any value, either public or private, static or dynamic (just so you know, the shortcuts way actually uses the generic way in the background).Īs with shortcuts, the generic way has a FROM alternate version. There are 3 ways to create a Tweener: the generic way, the shortcuts way and additional generic ways. (some of these values can be tweened in special ways)Īlso, you can create custom DOTween plugins to tween custom value types They take a property/field and animate it towards a given value.Īs of now DOTween can tween these types of values:įloat, double, int, uint, long, ulong, Vector2/3/4, Quaternion, Rect, RectOffset, Color, string Tweeners are the working ants of DOTween. EXAMPLE B: initialize with custom settings, and set capacities immediatelyĭOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(200, 10) Creating a Tweener EXAMPLE A: initialize with the preferences set in DOTween's Utility Panel
#Unity set volume scroll to current plus
LogBehaviour Depending on the chosen mode DOTween will log only errors, errors and warnings, or everything plus additional informations.
#Unity set volume scroll to current windows 10
WARNING: on iOS safeMode works only if stripping level is set to "Strip Assemblies" or Script Call Optimization is set to "Slow and Safe", while on Windows 10 WSA it won't work if Master Configuration and. UseSafeMode If set to TRUE tweens will be slightly slower but safer, allowing DOTween to automatically take care of things like targets being destroyed while a tween is running. You can change this setting at any time by changing the static faultRecyclable property, or you can set the recycling behaviour for each tween separately, using SetRecyclable If you want to automatically set your tween references to NULL when a tween is killed you can use the OnKill callback like this: This option allows you to avoid GC allocations by reusing tweens, but you will have to take care of tween references, since they might result active even if they were killed (since they might have been respawned and might now be in use as other completely different tweens). RecycleAllByDefault If TRUE all new tweens will be set for recycling, meaning that when killed they won't be destroyed but instead will be put in a pool and reused rather than creating new tweens. Call it without any parameter to use the preferences you set in DOTween's Utility Panel (otherwise they will be overrided by any eventual parameter passed). static DOTween.Init(bool recycleAllByDefault = false, bool useSafeMode = true, LogBehaviour logBehaviour = LogBehaviour.ErrorsOnly) Initializes DOTween. Optionally, you can chain SetCapacity to the Init method, which allows to set the max Tweeners/Sequences initial capacity (it's the same as calling DOTween.SetTweensCapacity later). If instead you prefer to initialize it yourself (recommended), call this methods once, BEFORE creating any tween (calling it afterwards will have no effect).Ĭonsider that you can still change all init settings whenever your want, by using DOTween's global settings The first time you create a tween, DOTween will initialize itself automatically, using default values. myTween.OnStart(myStartFunction).OnComplete(m圜ompleteFunction) DOTween.Init



myTween.SetLoops(4, LoopType.Yoyo).SetSpeedBased() On Prefix for all callbacks that can be chained to a tween. transform.DOMoveX(100, 1) ĭOTween.Play() Set Prefix for all settings that can be chained to a tween (except for From, since it's applied as a setting but is not really a setting). Also the prefix of the main DOTween class. Prefixes are important to use the most out of IntelliSense, so try to remember these: DO Prefix for all tween shortcuts (operations that can be started directly from a known object, like a transform or a material). Nested tween A tween contained inside a Sequence. Tween A generic word that indicates both a Tweener and a Sequence. Sequence A special tween that, instead of taking control of a value, takes control of other tweens and animates them as a group. Nomenclature Tweener A tween that takes control of a value and animates it.
