mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-15 01:12:05 +07:00
25 lines
565 B
C#
25 lines
565 B
C#
using UnityEngine;
|
|
using UnityEditor;
|
|
|
|
namespace IsoTools.Internal {
|
|
static class IsoEditorUtils {
|
|
public static void DoWithMixedValue(bool mixed, System.Action act) {
|
|
var last_show_mixed_value = EditorGUI.showMixedValue;
|
|
EditorGUI.showMixedValue = mixed;
|
|
try {
|
|
act();
|
|
} finally {
|
|
EditorGUI.showMixedValue = last_show_mixed_value;
|
|
}
|
|
}
|
|
|
|
public static void DoWithEnabledGUI(bool enabled, System.Action act) {
|
|
EditorGUI.BeginDisabledGroup(!enabled);
|
|
try {
|
|
act();
|
|
} finally {
|
|
EditorGUI.EndDisabledGroup();
|
|
}
|
|
}
|
|
}
|
|
} |