List <string> GetErrorMessagesFrom(Delighting.ErrorCode errorCode) { int width = 0, height = 0; if (baseTexture != null) { width = baseTexture.width; height = baseTexture.height; } var errors = new List <string>(); DelightingHelpers.GetErrorMessagesFrom(errorCode, errors, width, height); return(errors); }
internal static void GetErrorMessagesFrom(Delighting.ErrorCode errorCode, List <string> target, int width, int height) { s_GetErrorMessagesFrom_MissingTextures.Clear(); s_GetErrorMessagesFrom_WrongSizeTextures.Clear(); target.Clear(); if ((errorCode & Delighting.ErrorCode.MissingBaseTexture) != 0) { s_GetErrorMessagesFrom_MissingTextures.Add("Base Texture"); } if ((errorCode & Delighting.ErrorCode.MissingAmbientOcclusionTexture) != 0) { s_GetErrorMessagesFrom_MissingTextures.Add("Ambient Occlusion"); } else if ((errorCode & Delighting.ErrorCode.WrongSizeAmbientOcclusionTexture) != 0) { s_GetErrorMessagesFrom_WrongSizeTextures.Add("Ambient Occlusion"); } if ((errorCode & Delighting.ErrorCode.MissingNormalsTexture) != 0) { s_GetErrorMessagesFrom_MissingTextures.Add("Normals"); } else if ((errorCode & Delighting.ErrorCode.WrongSizeNormalsTexture) != 0) { s_GetErrorMessagesFrom_WrongSizeTextures.Add("Normals"); } if ((errorCode & Delighting.ErrorCode.MissingBentNormalsTexture) != 0) { s_GetErrorMessagesFrom_MissingTextures.Add("Bent Normals"); } else if ((errorCode & Delighting.ErrorCode.WrongSizeBentNormalsTexture) != 0) { s_GetErrorMessagesFrom_WrongSizeTextures.Add("Bent Normals"); } if ((errorCode & Delighting.ErrorCode.WrongSizePositionTexture) != 0) { s_GetErrorMessagesFrom_WrongSizeTextures.Add("Positions"); } if ((errorCode & Delighting.ErrorCode.WrongSizeMaskTexture) != 0) { s_GetErrorMessagesFrom_WrongSizeTextures.Add("Mask"); } if (s_GetErrorMessagesFrom_MissingTextures.Count > 0) { target.Add("Missing texture(s): " + string.Join(", ", s_GetErrorMessagesFrom_MissingTextures.ToArray())); } if (s_GetErrorMessagesFrom_WrongSizeTextures.Count > 0) { target.Add(string.Format("This texture(s) must have the same size as Base Texture ({0}x{1}): {2}", width, height, string.Join(", ", s_GetErrorMessagesFrom_WrongSizeTextures.ToArray()))); } if ((errorCode & Delighting.ErrorCode.ColorSpaceNotLinear) != 0) { target.Add(string.Format(@"Color Space must be linear, it is currently {0}. Please, go to Edit > Project Settings > Player in Other Settings change Color Space to Linear.", PlayerSettings.colorSpace)); } }
internal static EditorGUIX.FieldIcon GetIcon(Delighting.ErrorCode errorCode, Delighting.ErrorCode comparedToErrorCode) { return((errorCode & comparedToErrorCode) != 0 ? EditorGUIX.FieldIcon.Error : EditorGUIX.FieldIcon.None); }