+ editor utils

This commit is contained in:
2016-12-17 19:08:04 +07:00
parent 93b11c5ea0
commit 204960372a
2 changed files with 37 additions and 0 deletions

View 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();
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: caa7734062e9443fb80ebbbd5b4576fd
timeCreated: 1481976002
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: