Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if UNITY_EDITOR
- using System;
- using System.Collections.Generic;
- using System.IO;
- using UnityEditor;
- using UnityEngine;
- public class ModdingUtilitys : MonoBehaviour
- {
- [MenuItem("VTOLVR Modding/Fix Materials")]
- public static void FixMaterials()
- {
- Material[] mats = Resources.FindObjectsOfTypeAll(typeof(Material)) as Material[];
- int nullCount = 0;
- Shader standardShader = Shader.Find("Standard");
- for (int i = 0; i < mats.Length; i++)
- {
- if (mats[i].shader.name == string.Empty)
- {
- mats[i].shader = standardShader;
- nullCount++;
- }
- }
- Debug.Log($"Fixed {nullCount} shaders");
- }
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement