Skip to content

Commit

Permalink
fix: removed UIParticle will be saved in prefab mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Sep 1, 2020
1 parent 6eb9998 commit 08e2d51
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Packages/UIParticle/Scripts/Editor/UIParticleEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using UnityEditor.UI;
using UnityEngine;
using System.Collections.Generic;
using UnityEditor.Experimental.SceneManagement;
using UnityEditorInternal;
using UnityEngine.UI;

Expand Down Expand Up @@ -150,6 +151,12 @@ void DestroyUIParticle(UIParticle p, bool ignoreCurrent = false)
var cr = p.canvasRenderer;
DestroyImmediate(p);
DestroyImmediate(cr);

var stage = PrefabStageUtility.GetCurrentPrefabStage();
if (stage != null && stage.scene.isLoaded)
{
PrefabUtility.SaveAsPrefabAsset(stage.prefabContentsRoot, stage.prefabAssetPath);
}
}

bool FixButton(bool show, string text)
Expand Down

0 comments on commit 08e2d51

Please sign in to comment.