Detailed Event Reference
Namespace: Canley.Utility.ColourPicker
Class: CanleyColourController
OnPickerClosed
public event Action OnPickerClosed-
Description: Fired immediately after the picker UI is deactivated. This triggers regardless of how the picker was closed—whether through a successful “Confirm,” a “Cancel” reversion, or a manual script call to
ClosePicker(). -
Workflow:
- Trigger: Any action that deactivates the
_pickerPanelGameObject. - Invocation: The event fires with no parameters.
- Application: Used primarily to restore game state, such as unpausing time or re-enabling player movement.
- Trigger: Any action that deactivates the
-
Parameters:
- None
-
Example:
void OnEnable()
{
// Subscribe to the closure event
picker.OnPickerClosed += ResumeGame;
}
void OnDisable()
{
// Unsubscribe to prevent memory leaks
picker.OnPickerClosed -= ResumeGame;
}
void ResumeGame()
{
// Example: Restore game time if the picker was acting as a pause menu
Time.timeScale = 1f;
Debug.Log("Picker closed. Gameplay resumed.");
}TIP
If you need to know what color was picked before the window closed, use
OnColourConfirmedinstead. UseOnPickerClosedonly for general UI housekeeping.