private static Material[] GetShadowMaterial(Graphic_Collection g) { var collection = (Graphic[])subGraphics.GetValue(g); var shadows = collection.Select(item => item.GetColoredVersion(ShaderDatabase.Transparent, Color.black, Color.black).MatSingle).ToArray(); return(shadows); }
public static Material[] GetShadowMaterial(Graphic_Collection g) { FieldInfo subGraphics = typeof(Graphic_Collection).GetField("subGraphics", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); Graphic[] collection = (Graphic[])subGraphics.GetValue(g); Material[] shadows = new Material[collection.Length]; for (int i = 0; i < collection.Length; i++) { shadows[i] = collection[i].GetColoredVersion(ShaderDatabase.Transparent, Color.black, Color.black).MatSingle; } return(shadows); }