Struct GUIColorScope
A handy scope variable that sets UnityEngine.GUI.color to the given color, and automatically resets it to its original color when the scope ends
Implements
System.IDisposable
Namespace: Atlas
Assembly: Atlas.Runtime.dll
Syntax
public struct GUIColorScope : IDisposable
Examples
using UnityEngine;
namespace Atlas.Examples
{
public sealed class Example_GUIColorScope : MonoBehaviour
{
private void OnGUI()
{
GUILayout.Label( "Atlas rules (default color)" );
using ( new GUIColorScope( Color.red ) )
{
GUILayout.Label( "Atlas rules (red)" );
}
GUILayout.Label( "Atlas rules (default color)" );
}
}
}
Constructors
| Improve this Doc View SourceGUIColorScope(Color, Boolean)
Constructor
Declaration
public GUIColorScope(Color color, bool shouldSetColor = true)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Color | color | The target color |
System.Boolean | shouldSetColor | Optional conditional for bypassing color assignment |
Methods
| Improve this Doc View SourceDispose()
Ends the scope
Declaration
public void Dispose()
Implements
System.IDisposable