public static RenderTextureFormat?GetFormat(RenderTextureFormat preferred, IEnumerable <RenderTextureFormat> fallback = null) { if (Compatibility.IsFormatSupported(preferred)) { return(new RenderTextureFormat?(preferred)); } if (fallback == null) { WaterLogger.Error("Compatibility", "GetFormat", "preferred format not supported, and no fallback formats available for :" + preferred); return(null); } foreach (RenderTextureFormat renderTextureFormat in fallback) { if (SystemInfo.SupportsRenderTextureFormat(renderTextureFormat)) { WaterLogger.Warning("Compatibility", "GetFormat", "preferred format not supported, chosen fallback: " + renderTextureFormat); return(new RenderTextureFormat?(renderTextureFormat)); } } return(null); }