Пример #1
0
        //[MenuItem("tool/AssetTool/Replace Mat")]
        static void ReplaceComponentSelect()
        {
            //查找所有的mat中,是否有引用默认
            ReplaceDefaultMaterial rdm = new ReplaceDefaultMaterial("Default-Particle (Instance)", "Assets/Effect/Common/TDefault.mat");

            rdm.Run(Application.dataPath);

            EditorUtility.ClearProgressBar();
            //Repalce();
        }
Пример #2
0
        private static void Repalce()
        {
            UnityEngine.GameObject[] selections = Selection.gameObjects;
            ReplaceDefaultMaterial   rdm        = new ReplaceDefaultMaterial("Default-Particle (Instance)", "Assets/Effect/Common/TDefault.mat");

            foreach (var o in selections)
            {
                rdm.SetParticleSystemRecursively(o);
            }
            AssetDatabase.SaveAssets();
        }