[unity] Minor updates to editors.

This commit is contained in:
pharan 2018-04-20 12:05:32 +08:00
parent 69cb86eeef
commit 5766aa747d
3 changed files with 9 additions and 1 deletions

View File

@ -238,6 +238,12 @@ namespace Spine.Unity.Editor {
AssetDatabase.CreateAsset(newAsset, assetPath); AssetDatabase.CreateAsset(newAsset, assetPath);
} }
} }
var folderObject = AssetDatabase.LoadAssetAtPath(dataPath, typeof(UnityEngine.Object));
if (folderObject != null) {
Selection.activeObject = folderObject;
EditorGUIUtility.PingObject(folderObject);
}
} }
void OnInspectorGUIMulti () { void OnInspectorGUIMulti () {

View File

@ -75,6 +75,7 @@ namespace Spine.Unity.Editor {
} }
SerializedProperty dataField = property.FindBaseOrSiblingProperty(TargetAttribute.dataField); SerializedProperty dataField = property.FindBaseOrSiblingProperty(TargetAttribute.dataField);
if (dataField != null) { if (dataField != null) {
var objectReferenceValue = dataField.objectReferenceValue; var objectReferenceValue = dataField.objectReferenceValue;
if (objectReferenceValue is SkeletonDataAsset) { if (objectReferenceValue is SkeletonDataAsset) {

View File

@ -288,7 +288,6 @@ namespace Spine.Unity.Editor {
defaultShader = shader != null ? shader.name : DEFAULT_DEFAULT_SHADER; defaultShader = shader != null ? shader.name : DEFAULT_DEFAULT_SHADER;
if (EditorGUI.EndChangeCheck()) if (EditorGUI.EndChangeCheck())
EditorPrefs.SetString(DEFAULT_SHADER_KEY, defaultShader); EditorPrefs.SetString(DEFAULT_SHADER_KEY, defaultShader);
EditorGUILayout.Space();
EditorGUI.BeginChangeCheck(); EditorGUI.BeginChangeCheck();
setTextureImporterSettings = EditorGUILayout.Toggle(new GUIContent("Apply Atlas Texture Settings", "Apply the recommended settings for Texture Importers."), showHierarchyIcons); setTextureImporterSettings = EditorGUILayout.Toggle(new GUIContent("Apply Atlas Texture Settings", "Apply the recommended settings for Texture Importers."), showHierarchyIcons);
@ -296,6 +295,8 @@ namespace Spine.Unity.Editor {
EditorPrefs.SetBool(SET_TEXTUREIMPORTER_SETTINGS_KEY, showHierarchyIcons); EditorPrefs.SetBool(SET_TEXTUREIMPORTER_SETTINGS_KEY, showHierarchyIcons);
} }
EditorGUILayout.Space();
EditorGUILayout.LabelField("Editor Instantiation", EditorStyles.boldLabel); EditorGUILayout.LabelField("Editor Instantiation", EditorStyles.boldLabel);
EditorGUI.BeginChangeCheck(); EditorGUI.BeginChangeCheck();
defaultZSpacing = EditorGUILayout.Slider("Default Slot Z-Spacing", defaultZSpacing, -0.1f, 0f); defaultZSpacing = EditorGUILayout.Slider("Default Slot Z-Spacing", defaultZSpacing, -0.1f, 0f);