Exemplo n.º 1
0
        public static void DeleteSpriteRenderer()
        {
            const string assetPath = "Assets/Res/UI";

            DeleteSpriteRenderer(
                EnumAssets.EnumAllComponentDependenciesRecursive <SpriteRenderer>(
                    EnumAssets.EnumAssetAtPath <UnityEngine.Object>(assetPath)));
        }
Exemplo n.º 2
0
        //优化资源
        public static void OptimizingScenePrefab()
        {
            const string ASSET_PATH = "Assets/Res/Scene";


            RemoveSameMeshColliderComponent.RemoveSameMeshColliderInEnumAssetAtPath(EnumAssets.EnumAssetAtPath <UnityEngine.Object>(ASSET_PATH));
            ShadowsCloseTools.CloseShadows(EnumAssets.EnumAllComponentDependenciesRecursive <Renderer>(EnumAssets.EnumAssetAtPath <UnityEngine.Object>(ASSET_PATH)));
            //AnimationClipTool.ChangeAnimatorToAnimationInPath(ASSET_PATH);
            T4MComponentDisable.T4MComponentDisablemethod(EnumAssets.EnumAllComponentDependenciesRecursive <T4MObjSC>(EnumAssets.EnumAssetAtPath <UnityEngine.Object>(ASSET_PATH)));
            DrawcallOptimize.DrawcallOptimizemethod(ASSET_PATH);
        }
Exemplo n.º 3
0
    public static bool ChangeAnimatorToAnimationInPath(string ASSET_PATH)
    {
        EditorUtility.DisplayProgressBar("Change Animator to Animation in Path", "Collecting MeshRenderer Components", 0);
        string str = "";

        Debug.Log("ChangeAnimatorToAnimation----------------begin");
        int i   = 0;
        var gos =
            EnumAssets.EnumAllComponentDependenciesRecursive <Animator>(
                EnumAssets.EnumAssetAtPath <UnityEngine.Object>(ASSET_PATH));

        int total = 0;

        {
            // foreach(var c in gos)
            var __enumerator3 = (gos).GetEnumerator();
            while (__enumerator3.MoveNext())
            {
                var c = __enumerator3.Current;
                {
                    total++;
                }
            }
        }
        {
            // foreach(var go in gos)
            var __enumerator4 = (gos).GetEnumerator();
            while (__enumerator4.MoveNext())
            {
                var go = __enumerator4.Current;
                {
                    EditorUtility.DisplayProgressBar("Change Animator to Animation in Path", go.gameObject.name, i * 1.0f / total);
                    var g = go.gameObject;

                    AnimationOptimizing(go);


                    str += "[" + g.transform.FullPath() + "]\n";
                    i++;
                }
            }
        }
        EditorUtility.ClearProgressBar();
        if (!string.IsNullOrEmpty(str))
        {
            Debug.Log(str);
        }

        AssetDatabase.Refresh();
        AssetDatabase.SaveAssets();

        Debug.Log("ChangeAnimatorToAnimation-Total=[" + i.ToString() + "]---------------end");
        return(true);
    }