Skip to content

Commit

Permalink
fix: in Unity 2018.2, PrefabStageUtility is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Sep 1, 2020
1 parent b82fe05 commit 0b6dcff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Packages/UIParticle/Scripts/Editor/UIParticleEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using UnityEditor.UI;
using UnityEngine;
using System.Collections.Generic;
using UnityEditor.Experimental.SceneManagement;
using UnityEditorInternal;
using UnityEngine.UI;

Expand Down Expand Up @@ -152,11 +151,13 @@ void DestroyUIParticle(UIParticle p, bool ignoreCurrent = false)
DestroyImmediate(p);
DestroyImmediate(cr);

var stage = PrefabStageUtility.GetCurrentPrefabStage();
#if UNITY_2018_3_OR_NEWER
var stage = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
if (stage != null && stage.scene.isLoaded)
{
PrefabUtility.SaveAsPrefabAsset(stage.prefabContentsRoot, stage.prefabAssetPath);
}
#endif
}

bool FixButton(bool show, string text)
Expand Down

0 comments on commit 0b6dcff

Please sign in to comment.