Forum rules - please read before posting.

Support for HDR Color in custom actions

Hi,

I'd like to request support for HDR Colors & color pickers in custom actions. Currently you can do a Vector4 field but it's not as fluid as being able to use an HDR color picker.

Olly

Comments

  • Having Unity display its HDR colour picker is a case of attaching the ColorUsage attribute to the colour variable, i.e.:

    [ColorUsage (true, true)] public Color myColor;
    

    IIRC, however, such attributes are ignored by Unity when fields are used in custom Editors such as Actions.

    To get around this, you can serialize the Action and use a PropertyField to represent the field in the Action's ShowGUI function, rather than a specific field type:

    var serializedObject = new SerializedObject (this);
    serializedObject.Update ();
    SerializedProperty vectorProperty = serializedObject.FindProperty ("myColor");
    EditorGUILayout.PropertyField (vectorProperty, true);
    serializedObject.ApplyModifiedProperties ();
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.