用腳本保存prefab


 1 [ExecuteInEditMode]
 2 public class WipeOutDepthPass : MonoBehaviour  {
 3 
 4     [MenuItem("Happi/wipte out all depth pass")]
 5     private static void Execute()
 6     {
 7         UIPanel[] panels = GameObject.FindObjectsOfType(typeof(UIPanel)) as UIPanel[];
 8         foreach(UIPanel panel in panels)
 9         {
10             panel.depthPass = false;
11             if(PrefabUtility.GetPrefabParent(panel) != null)
12                 PrefabUtility.ReplacePrefab(panel.gameObject, PrefabUtility.GetPrefabParent(panel),ReplacePrefabOptions.ConnectToPrefab);
13             
14         }
15         EditorApplication.SaveScene(EditorApplication.currentScene);
16     }
17 }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM