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:

    1. Trigger: Any action that deactivates the _pickerPanel GameObject.
    2. Invocation: The event fires with no parameters.
    3. Application: Used primarily to restore game state, such as unpausing time or re-enabling player movement.
  • 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 OnColourConfirmed instead. Use OnPickerClosed only for general UI housekeeping.