static void RemoveEmptyPrefab() { var files = PrefabCollect.Collect(Selection.objects, isNeedCheck); SaveSelectPrefab(files, "移除空组件", (obj, customizeData) => { if (customizeData == null || string.IsNullOrEmpty(customizeData.TypeName) || IL.Help.GetType(customizeData.TypeName) == null) { Object.DestroyImmediate(obj); return(true); } return(false); }, null); }
static void OneAll() { var files = PrefabCollect.Collect(Selection.objects, isNeedCheck); var start = System.DateTime.Now; // 1 先以anyObject存储的数据保存到bytes当中 SaveToBytes(files, "开始第1步", () => { // 2 再清除所有anyValue数据 CleraAnyValue(files, "开始第2步", () => { // 3 以bytes数据来恢复anyValue数据 SaveToAnyValue(files, "开始第3步", () => { var now = System.DateTime.Now; Debug.Log($"一键操作完成用时:{(now - start).TotalSeconds}分!"); }); }); }); }
static void Step3() { var files = PrefabCollect.Collect(Selection.objects, isNeedCheck); SaveToAnyValue(files, "bytes->AnyObject", null); }
static void Step2() { var files = PrefabCollect.Collect(Selection.objects, isNeedCheck); CleraAnyValue(files, "清除AnyObject", null); }
static void Step1() { var files = PrefabCollect.Collect(Selection.objects, isNeedCheck); SaveToBytes(files, "AnyObject->bytes", () => { }); }