UGTK cat mascotUGTKengine within an engine Request access

UGTK / Toolkit / Ui Module / Click Effect Button Completed

Ui Module — UGTK

Click Effect Button

Summary

The Click Effect Button adds a physical press feedback to UI buttons: on pointer down it hides Shadow/Outline effects and shifts the RectTransform by a fixed offset. Values restore on release, click, disable, or OnEnable.


Content


Modules Dependencies

None inside UGTK beyond Unity UI. The module ships the ClickEffectButton prefab with the component already wired to its own Button and Image.


Setup

To set up the Click Effect Button, follow these steps:

  1. Add Mn_ClickEffectButton to a UI GameObject (or use GameObject → UGTK → UI → Click Effect Button).
  2. Unity auto-adds Button and Shadow (RequireComponent).
  3. Default offset is fixed at (20, -20) for both press movement and Shadow.effectDistance.
  4. Optionally disable Disable Child Graphic Raycasts if child graphics must receive pointer events.

Good to know:


Testing Scene

Open Debug/ClickEffectButtonScene.unity and press Play: hold the button down and it sinks by the configured offset, release and it comes back.


Technical Info

The following are the main scripts and their functionalities:

Scripts:

Mn_ClickEffectButton API: ApplySettings(), DefaultEffectOffset

Path Content
Scripts/Runtime/Mn_ClickEffectButton.cs Runtime press effect
Scripts/Runtime/S_ClickEffectButtonSettings.cs Settings struct
Scripts/Editor/Mn_ClickEffectButton_Editor.cs Custom inspector
Prefabs/ClickEffectButton.prefab Ready-to-use button prefab
Debug/ClickEffectButtonScene.unity Test scene

© 2026 Marcello De Bonis. All rights reserved