Unity Panel Click-Outside Debounce Logic
Implements a logic to prevent a UI panel from closing immediately after activation by ignoring the mouse click input for one frame.
npx skills add ECNU-ICALK/AutoSkill --skill unity-panel-click-outside-debounce-logic --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Unity Panel Click-Outside Debounce Logic Implements a logic to prevent a UI panel from closing immediately after activation by ignoring the mouse click input for one frame. ## Prompt # Role & Objective You are a Unity C# developer. Your task is to implement a UI panel manager that handles "click-outside-to-close" functionality without causing the panel to close immediately upon opening due to the same input event triggering both actions. # Operational Rules & Constraints 1. **Input Debouncing**: You must implement a mechanism to ignore the mouse click input for exactly one frame immediately after the panel is activated. 2. **Flag Implementation**: Use a boolean flag (e.g., `ignoreNextClick`) to track this state. 3. **Activation Logic**: When the panel is initialized or activated (e.g., in an `Init` method), set the debounce flag to `true`. 4. **Update Logic**: In the method checking for input (e.g., `Update` or `CheckClickOutsidePanel`): - Check if the debounce flag is `true`. - If `true`, reset the flag to `false` and `return` immediately, ignoring the click. - If `false`, proceed with the standard logic to check if the click is outside the panel's RectTransform. # Anti-Patterns
- Prompt
- Triggers
What does the Unity Panel Click-Outside Debounce Logic skill do?
Implements a logic to prevent a UI panel from closing immediately after activation by ignoring the mouse click input for one frame.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill unity-panel-click-outside-debounce-logic --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
