|
|
@@ -154,11 +154,10 @@ public class SkeletonDataMonitor
|
|
|
|
|
|
private static void WriteData(string path)
|
|
|
{
|
|
|
+ GameObject prefab = AssetDatabase.LoadAssetAtPath<GameObject>(path);
|
|
|
+ GameObject prefabInstance = PrefabUtility.InstantiatePrefab(prefab) as GameObject;
|
|
|
try
|
|
|
{
|
|
|
- GameObject prefab = AssetDatabase.LoadAssetAtPath<GameObject>(path);
|
|
|
- GameObject prefabInstance = PrefabUtility.InstantiatePrefab(prefab) as GameObject;
|
|
|
-
|
|
|
cha = prefabInstance.GetComponent<Character>();
|
|
|
ReadData(prefabInstance);
|
|
|
PrefabUtility.SaveAsPrefabAsset(prefabInstance, path);
|
|
|
@@ -168,6 +167,10 @@ public class SkeletonDataMonitor
|
|
|
{
|
|
|
Debug.LogError($"´¦ÀíPrefabʱ³ö´í({path}): {ex.Message}");
|
|
|
}
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ UnityEngine.Object.DestroyImmediate(prefabInstance);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
static void ReadData(GameObject prefab)
|