Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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}分!");
                    });
                });
            });
        }
Ejemplo n.º 3
0
        static void Step3()
        {
            var files = PrefabCollect.Collect(Selection.objects, isNeedCheck);

            SaveToAnyValue(files, "bytes->AnyObject", null);
        }
Ejemplo n.º 4
0
        static void Step2()
        {
            var files = PrefabCollect.Collect(Selection.objects, isNeedCheck);

            CleraAnyValue(files, "清除AnyObject", null);
        }
Ejemplo n.º 5
0
        static void Step1()
        {
            var files = PrefabCollect.Collect(Selection.objects, isNeedCheck);

            SaveToBytes(files, "AnyObject->bytes", () => { });
        }