mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-16 22:16:55 +07:00
+ editor utils
This commit is contained in:
25
Assets/IsoTools/Scripts/Internal/Editor/IsoEditorUtils.cs
Normal file
25
Assets/IsoTools/Scripts/Internal/Editor/IsoEditorUtils.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: caa7734062e9443fb80ebbbd5b4576fd
|
||||||
|
timeCreated: 1481976002
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Reference in New Issue
Block a user