fix 2019 deprecation warnings

This commit is contained in:
BlackMATov
2021-01-08 15:05:45 +07:00
parent 93baf5e7e9
commit 795da42197

View File

@@ -57,14 +57,12 @@ namespace FTEditor.Editors {
if ( clip_go ) {
var prefab_path = GetPrefabPath(clip);
if ( !string.IsNullOrEmpty(prefab_path) ) {
var prefab = AssetDatabase.LoadMainAssetAtPath(prefab_path);
if ( !prefab ) {
prefab = PrefabUtility.CreateEmptyPrefab(prefab_path);
}
result = PrefabUtility.ReplacePrefab(
clip_go,
prefab,
ReplacePrefabOptions.ConnectToPrefab);
prefab_path = AssetDatabase.GenerateUniqueAssetPath(prefab_path);
#if UNITY_2018_3_OR_NEWER
result = PrefabUtility.SaveAsPrefabAsset(clip_go, prefab_path);
#else
result = PrefabUtility.CreatePrefab(prefab_path, clip_go);
#endif
}
GameObject.DestroyImmediate(clip_go, true);
}