using UnityEngine; using System.Collections; public class ShaderFix : MonoBehaviour { private void Awake() { #if UNITY_EDITOR foreach (Transform t in gameObject.GetComponentsInChildren()) { if (t.gameObject.GetComponent() != null) { t.gameObject.GetComponent().material.shader = Shader.Find(t.gameObject.GetComponent().material.shader.name); } } #endif } }