This library helps you to upgrade your existing project to Unity 2018.
usingUnity2018UpgradeTools;usingUnityEditor;publicclassUnity2018Upgrading{[MenuItem("Assets/Analyze Shader Usage")]staticvoidAnalyze(){Materials.SearchMaterials(new[]{"Assets/Materials"}).AnalyzeShaderUsage().Log();}}This will generate logs in console that indicates which shaders are used by materials.
It's useful to find shaders/materials you should rewrite for SRP compatible.
usingUnity2018UpgradeTools;usingUnityEditor;publicclassUnity2018Upgrading{[MenuItem("Assets/Bulk Update Shaders")]staticvoidBulkUpdate(){Materials.SearchMaterials(new[]{"Assets/Materials"}).UsingShader("Unlit/Color").ReplaceShader("Lightweight/Unlit/Color");}}This will update a shader of materials that has a specified shader to new shader.
usingUnity2018UpgradeTools;usingUnityEditor;publicclassUnity2018Upgrading{[MenuItem("Assets/Bulk Update Particles in Assets")]staticvoidUpdateParticlesInAssets(){GameObjects.Search(new[]{"Assets/Materials"}).ParticleSystems().EnableGPUInstancing();}[MenuItem("Assets/Bulk Update Particles in Scene")]staticvoidUpdateParticlesInScene(){GameObjects.AllInScene().ParticleSystems().EnableGPUInstancing();}}This will update particle systems that has billboard render mode to use mesh & GPU Instancing.
usingUnity2018UpgradeTools;usingUnityEditor;publicclassUnity2018Upgrading{[MenuItem("Assets/Bulk Update Missing GPU Instancing/Dry Run")]staticvoidShowMissingGPUInstancing(){Materials.SearchMaterials(new[]{"Assets/Materials"}).FindMissingGPUInstancingMaterials().Log();}[MenuItem("Assets/Bulk Update Missing GPU Instancing/Run")]staticvoidUpdateMissingGPUInstancing(){Materials.SearchMaterials(new[]{"Assets/Materials"}).FindMissingGPUInstancingMaterials().EnableGPUInstancing();}}This will find materials with a shader that has a GPU Instancing variant but with a Enable GPU Instancing field is off.
Dry Runwill display such materials in console.Runwill set material'sEnable GPU Instancingto on.