/// <summary> /// Get the material color of an item including dye /// </summary> /// <param name="item">item to get the color from</param> /// <returns></returns> public static Color GetColor(RemoteFortressReader.Item item) { var color = GetColor(item.material); var dye = item.dye; if (dye != null) { color *= (Color) new Color32((byte)dye.red, (byte)dye.green, (byte)dye.blue, 255); } return(color); }
/// <summary> /// Get the material color of an item including dye /// </summary> /// <param name="item">item to get the color from</param> /// <returns></returns> public static Color GetColor(RemoteFortressReader.Item item) { var color = GetColor(item.type, item.material); var dye = item.dye; if (dye == null) { return(color); } if (!Application.isPlaying) { if (dye.red + dye.green + dye.blue == 0) { return(color); } } color *= (Color) new Color32((byte)dye.red, (byte)dye.green, (byte)dye.blue, 255); return(color); }