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/LabelWidth.cs

24 lines
544 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace AYellowpaper.SerializedCollections.Editor
{
public struct LabelWidth : IDisposable
{
public float PreviousWidth { get; }
public LabelWidth(float width)
{
PreviousWidth = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = width;
}
public void Dispose()
{
EditorGUIUtility.labelWidth = PreviousWidth;
}
}
}