-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Utilize scriptable importer for better workflow
- Loading branch information
Showing
6 changed files
with
97 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
Assets/Plugins/MetaSprite/Editor/Internal/ASEImporterEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#if UNITY_2020_2_OR_NEWER | ||
#define SCRIPTABLE_IMPORTERS | ||
using UnityEditor.AssetImporters; | ||
#elif UNITY_2019_4_OR_NEWER | ||
#define SCRIPTABLE_IMPORTERS | ||
using UnityEditor.Experimental.AssetImporters; | ||
#endif | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
#if SCRIPTABLE_IMPORTERS | ||
namespace MetaSprite.Internal { | ||
|
||
[CustomEditor(typeof(ASEImporter))] | ||
public class ASEImporterEditor : ScriptedImporterEditor { | ||
public override void OnInspectorGUI() { | ||
// EditorGUILayout.LabelField("Hello?"); | ||
base.OnInspectorGUI(); | ||
|
||
var importer = (ASEImporter) target; | ||
GUI.enabled = importer.settings; | ||
EditorGUILayout.BeginHorizontal(); | ||
|
||
GUILayout.FlexibleSpace(); | ||
if (GUILayout.Button("Import", GUILayout.Width(50))) { | ||
ASEImportProcess.Startup(); | ||
ASEImportProcess.Import(importer.assetPath, importer.settings); | ||
} | ||
|
||
EditorGUILayout.EndHorizontal(); | ||
} | ||
} | ||
} | ||
#endif |
3 changes: 3 additions & 0 deletions
3
Assets/Plugins/MetaSprite/Editor/Internal/ASEImporterEditor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters