Ejemplo n.º 1
0
 private static void Menu_DebugView()
 {
     foreach (var mat in MaterialSeeker.GetSelectionAllMaterial(MatSelectMode.FromAsset))
     {
         WFCommonUtility.ChangeShader(WF_DebugViewEditor.SHADER_NAME_DEBUGVIEW, mat);
     }
 }
Ejemplo n.º 2
0
        public static void ScanAndMigration()
        {
            // Go Ahead
            var done = MaterialSeeker.SeekProjectAllMaterial("migration materials", Migration);

            if (0 < done)
            {
                AssetDatabase.SaveAssets();
                Debug.LogFormat("[WF] Scan And Migration {0} materials", done);
            }
        }
Ejemplo n.º 3
0
        private static void Menu_KeepMaterialInScene()
        {
            var mats = MaterialSeeker.GetSelectionAllMaterial(MatSelectMode.FromAsset);

            var go = new GameObject("MaterialKeeper");

            go.tag = "EditorOnly";
            var mr = go.AddComponent <MeshRenderer>();

            mr.enabled   = false;
            mr.materials = mats.ToArray();
        }
            public List <UsedShaderVariant> CreateUsedShaderVariantList(out int materialCount)
            {
                var materials = new List <Material>();

                var sw = new System.Diagnostics.Stopwatch();

                sw.Start();

                // シーンから UsedShaderVariant を回収
                materials.AddRange(MaterialSeeker.GetAllSceneAllMaterial());
                materials = materials.Distinct()
                            .Where(mat => mat != null && IsStripTargetShader(mat.shader))
                            .ToList();
                materialCount = materials.Count;

                foreach (var mat in materials)
                {
                    AppendUsedShaderVariant(mat, mat.shader);
                }

                sw.Stop();

                var result = usedShaderVariantList.Distinct().ToList();

#if WF_STRIP_LOG_SCAN_RESULT
                foreach (var mat in materials)
                {
                    Debug.Log(string.Format("[WF][Preprocess] find materials in scene: {0}", mat), mat);
                }
                foreach (var uv in result)
                {
                    Debug.LogFormat("[WF][Preprocess] used variant: {0}", uv);
                }
#endif

                Debug.LogFormat("[WF][Preprocess] fnish scene material scanning: {0} ms, {1} materials, {2} usedShaderVariantList", sw.ElapsedMilliseconds, materialCount, result.Count);
                return(result);
            }
Ejemplo n.º 5
0
        private static void Menu_AutoConvertMaterial()
        {
            var mats = MaterialSeeker.GetSelectionAllMaterial(MatSelectMode.FromAssetDeep);

            new WFMaterialFromOtherShaderConverter().ExecAutoConvert(mats.ToArray());
        }
Ejemplo n.º 6
0
 public static void SetSelectedMaterials(MatSelectMode mode)
 {
     arguments.Clear();
     arguments.AddRange(MaterialSeeker.GetSelectionAllMaterial(mode));
 }
Ejemplo n.º 7
0
        private static void Menu_ChangeMobileShader()
        {
            var mats = MaterialSeeker.GetSelectionAllMaterial(MatSelectMode.FromAssetDeep);

            ChangeMobileShader(mats.ToArray());
        }