用脚本保存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