How do I get the color linked to a script object (uGUI uCPf color picker)

Hi all

I’ve recently looked at using the uGUI color picker from the asset store.

It looks the part and has been set up to go where it’s meant to go in the game but now I need to get the selected color.

The document that comes with it doesn’t explain how to get the colour out of the selection bar pointing out it comes from the “Color Picker” HSV value.

From the readme:

There is a preset prefab in prefabs folder.

Path : “Assets/uCUIColorPicker/Prefabs”

When put “PresetColorPicker” prefab in a canvas, You just need to set a OnChange event.

Then it will work nicely!


For the output event, you can make a property or a function.

example C# code.

/-----------------------------------------------/

// property.

public Color someProperty { get; set; }

// function.

public void someFunction ( Color c )

{

// TODO something.

}

/-----------------------------------------------/

If objects have this code, the event is able to setect it as a dynamic parameter.


I don’t see how I can get the value by adding either of these to any object, and it really should be a static property. The only solution I can see is to pick the color up from the script object “Color Picker” which has a color bar that changes upon selection.

Any advice would be awesome…

Thanks.

hello , plz i need this asset if possible
thanks