Files
trail-into-darkness/Packages/ayellowpaper.serialized-dictionary/Editor/Scripts/Utility/GUIEnabledScope.cs
2026-04-02 07:22:33 +02:00

23 lines
502 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace AYellowpaper.SerializedCollections.Editor
{
public struct GUIEnabledScope : IDisposable
{
public readonly bool PreviouslyEnabled;
public GUIEnabledScope(bool enabled)
{
PreviouslyEnabled = GUI.enabled;
GUI.enabled = enabled;
}
public void Dispose()
{
GUI.enabled = PreviouslyEnabled;
}
}
}