mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-15 03:21:35 +08:00
Initial import error fix
This commit is contained in:
parent
f7d8b9d3f9
commit
9911183a3d
@ -42,6 +42,7 @@ public class AtlasAssetInspector : Editor {
|
||||
private SerializedProperty atlasFile, materials;
|
||||
|
||||
void OnEnable () {
|
||||
SpineEditorUtilities.ConfirmInitialization();
|
||||
atlasFile = serializedObject.FindProperty("atlasFile");
|
||||
materials = serializedObject.FindProperty("materials");
|
||||
}
|
||||
|
||||
@ -60,6 +60,8 @@ public class SkeletonDataAssetInspector : Editor {
|
||||
|
||||
void OnEnable() {
|
||||
|
||||
SpineEditorUtilities.ConfirmInitialization();
|
||||
|
||||
try {
|
||||
atlasAssets = serializedObject.FindProperty("atlasAssets");
|
||||
skeletonJSON = serializedObject.FindProperty("skeletonJSON");
|
||||
|
||||
@ -36,6 +36,7 @@ public class SkeletonRendererInspector : Editor {
|
||||
protected SerializedProperty skeletonDataAsset, initialSkinName, normals, tangents, meshes, immutableTriangles, submeshSeparators;
|
||||
|
||||
protected virtual void OnEnable () {
|
||||
SpineEditorUtilities.ConfirmInitialization();
|
||||
skeletonDataAsset = serializedObject.FindProperty("skeletonDataAsset");
|
||||
initialSkinName = serializedObject.FindProperty("initialSkinName");
|
||||
normals = serializedObject.FindProperty("calculateNormals");
|
||||
|
||||
@ -146,8 +146,13 @@ public class SpineEditorUtilities : AssetPostprocessor {
|
||||
public static float defaultScale = 0.01f;
|
||||
public static float defaultMix = 0.2f;
|
||||
public static string defaultShader = "Spine/Skeleton";
|
||||
public static bool initialized;
|
||||
|
||||
static SpineEditorUtilities() {
|
||||
Initialize();
|
||||
}
|
||||
|
||||
static void Initialize(){
|
||||
DirectoryInfo rootDir = new DirectoryInfo(Application.dataPath);
|
||||
FileInfo[] files = rootDir.GetFiles("SpineEditorUtilities.cs", SearchOption.AllDirectories);
|
||||
editorPath = Path.GetDirectoryName(files[0].FullName.Replace("\\", "/").Replace(Application.dataPath, "Assets"));
|
||||
@ -162,6 +167,12 @@ public class SpineEditorUtilities : AssetPostprocessor {
|
||||
EditorApplication.hierarchyWindowItemOnGUI += HierarchyWindowItemOnGUI;
|
||||
|
||||
HierarchyWindowChanged();
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
public static void ConfirmInitialization(){
|
||||
if(!initialized || Icons.skeleton == null)
|
||||
Initialize();
|
||||
}
|
||||
|
||||
static void HierarchyWindowChanged() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user