This repository has been archived on 2025-06-25. You can view files and clone it, but cannot push or open issues or pull requests.
Net.Like.Xue.Tokyo/Assets/Plugins/SerializedCollections/Editor/Scripts/Utility/GUIEnabledScope.cs

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;
}
}
}