A Unity extension that integrates DOTween with Flexalon, providing extension methods for animating Flexalon layout properties.
- Extension Methods - Familiar API for animating
FlexalonObjectproperties via DOTween. - Property Support - Animate
Offset,Rotation,Scale,Size,Margin, andPadding. - Motion Variants - Standard, Punch, and Shake animations for Offset, Rotation, and Scale.
- Full DOTween Integration - Returns
TweenerCoretypes, supportsAxisConstraint,RotateMode,ShakeRandomnessMode, snapping, and all standard DOTween chaining.
Add this package to your Unity project via the Package Manager.
In your Unity project, install DOTween.
Important
The set up window will automatically show when first installing DOTween, to access it any other time, go to Menu Bar > Tools > Demigiant > DOTween Utility Panel.
In the DOTween setup window, create an Assembly Definition for DOTween.
This ensures the DOTween assemblies can be referenced cleanly from DOTween-Flexalon.
https://github.com/Tirtstan/DOTween-Flexalon.git
Dependencies:
- DOTween
- Flexalon
using DG.Tweening;
using DG.Tweening.Flexalon;
using Flexalon;
// Animate offset
flexalonObject.DOFlexalonOffset(new Vector3(100f, 0f, 0f), 1f);
// Animate single axis (uses DOTween's AxisConstraint internally)
flexalonObject.DOFlexalonOffsetX(100f, 1f);
// Animate rotation (Euler angles) with RotateMode
flexalonObject.DOFlexalonEulerAngles(new Vector3(0f, 180f, 0f), 1f, RotateMode.FastBeyond360)
.SetEase(Ease.OutBack);
// Animate rotation (pure Quaternion)
flexalonObject.DOFlexalonRotation(Quaternion.Euler(0f, 90f, 0f), 1f);
// Animate scale
flexalonObject.DOFlexalonScale(Vector3.one * 1.5f, 0.5f)
.SetEase(Ease.OutElastic);
// Uniform scale
flexalonObject.DOFlexalonScale(2f, 0.5f);
// Punch & Shake (with ShakeRandomnessMode support)
flexalonObject.DOPunchFlexalonOffset(Vector3.up * 20f, 0.5f);
flexalonObject.DOShakeFlexalonScale(0.5f, 0.3f, randomnessMode: ShakeRandomnessMode.Harmonic);
// Size tweens (with snapping support)
flexalonObject.DOFlexalonWidth(2f, 1f, snapping: true);
flexalonObject.DOFlexalonSize(new Vector3(2f, 3f, 1f), 1f);
// Margin & Padding tweens
flexalonObject.DOFlexalonMarginLeft(10f, 0.5f);
flexalonObject.DOFlexalonPaddingTop(5f, 0.5f);