Advertisement

Unity编辑器工具拓展(二)——批量修改预制体

阅读量:

在实际操作过程中,面对需要集中调整多个预制体相同属性的情况,采用手动方式往往效率低下,而借助相关工具则能显著提升操作便捷性。

以Text组件的BestFit属性调整为例,通过编写代码实现批量修改将更为高效,具体实现方式如下:

复制代码
 using System.Collections;

    
 using System.Collections.Generic;
    
 using UnityEngine;
    
 using UnityEditor;
    
 using System.IO;
    
 using UnityEngine.UI;
    
  
    
 public class EditorTest2 : EditorWindow
    
 {
    
     EditorTest2()
    
     {
    
     this.titleContent = new GUIContent("测试窗口2");
    
     this.maxSize = new Vector2(300,400);
    
     this.minSize = new Vector2(300, 400);
    
     }
    
  
    
  
    
     [MenuItem("Tools/测试窗口2")

全部评论 (0)

还没有任何评论哟~