Sorry I wasn't specific enough Aren, I was referring to the color field in the inspector of the UILabel under the widget header.
So the problem I have with altering the color variable of the UILabel is that it doesn't effect the actual color of the text, just the color field on the inspector; at least not when I'm attempting to do it from a different editor script. Some example code:
public class TextObject : MonoBehaviour
{
public UILabel label;
}
[CustomEditor(typeof(TextObject))]
public class TextFieldInspector : Editor
{
public override void OnInspectorGUI ()
{
TextObject _target = (TextObject)target;
_target.label = _target.gameObject.GetComponentInChildren<UILabel>();
_target.TextColor = EditorGUILayout.ColorField("Text Color", _target.TextColor);
if (GUI.changed)
{
_target.label.color = _target.TextColor;
}
}
}
Where the UILabel i'm attempting to effect is a child of a panel in the top level object's children. This code reproduces my problem that it will update the color swatch in the inspector of the UILabel, but it doesn't impact the actual color of the text, and when the game is started all the information is reset to it's previous value before the color field in the editor script was altered.