HookAnimator Component
While you can use DOTween or Coroutines manually, HookUI provides the HookAnimator: a data-driven, visual animation system designed specifically for UI.
Why use it?
- Presets: Create one "Pop Up" animation and reuse it on 50 different panels.
- Visual Editor: Tweak scale, fade, and position curves in the Inspector.
- Preview: Test "Show" and "Hide" animations directly in the Editor without hitting Play.
Setup
- Add
HookAnimatorComponentto yourHookViewGameObject. - The
HookViewwill automatically detect it and use it forShow()/Hide()calls (unless you override them manually).
Creating Animations
You can configure two animations:
- Show Animation: Played when the View opens.
- Hide Animation: Played when the View closes.
Properties
- Duration: Time in seconds.
- Delay: Time before starting.
- Scale: Animate from/to scale (Using AnimationCurves).
- Fade: Animate CanvasGroup Alpha.
- Move: Animate AnchoredPosition.
The Preset Workflow
This is the "OP" feature. Instead of configuring values on every GameObject:
- Configure your perfect animation on one object.
- Use the context menu or button: Export SHOW to New Asset.
- Save it as
Anim_SimplePop.asset. - Reuse: On another object, drag
Anim_SimplePopinto the Target Preset field. - Click Load Preset into SHOW.
Boom! Instant consistent animations across your entire game.
Previewing
Use the slider in the Inspector (when implemented in custom editor) or the Context Menu buttons (Play Show, Play Hide) to preview the feel of the animation instantly.