arthurdiniz0_outer-math/OuterMath Unity Project/Assets/PlayMaker/Actions/GUI/SetGUIColor.cs
// (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
	[ActionCategory(ActionCategory.GUI)]
	[Tooltip("Sets the Tinting Color for the GUI. By default only effects GUI rendered by this FSM, check Apply Globally to effect all GUI controls.")]
	public class SetGUIColor : FsmStateAction
	{
		[RequiredField]
        [Tooltip("Tint Color for the GUI.")]
        public FsmColor color;

        [Tooltip("Apply this setting to all GUI calls, even in other scripts.")]
        public FsmBool applyGlobally;
	
		public override void Reset()
		{
			color = Color.white;
		}

		public override void OnGUI()
		{
			GUI.color = color.Value;
			
			if (applyGlobally.Value)
			{
				PlayMakerGUI.GUIColor = GUI.color;
			}
		}
	}
}