public static Gradient GetGradient(Texture texture) { if (texture != null) { string gradient_data_string = FileHelper.LoadValueFromFile(texture.name, PATH.GRADIENT_INFO_FILE); if (gradient_data_string != null) { return(Parser.ParseToObject <Gradient>(gradient_data_string)); } return(Converter.TextureToGradient(GetReadableTexture(texture))); } return(new Gradient()); }
/// If gradient is saved get exact value, else tries to build it from texture public static Gradient GetGradient(Texture texture) { if (texture != null) { string gradient_data_string = Helper.LoadValueFromFile(texture.name, ".thry_gradients"); if (gradient_data_string != null) { return(Parser.ParseToObject <Gradient>(gradient_data_string)); } return(Converter.TextureToGradient(Helper.GetReadableTexture(texture))); } return(new Gradient()); }
public static Gradient GetGradient(Texture texture) { if (texture != null) { string gradient_data_string = FileHelper.LoadValueFromFile(texture.name, PATH.GRADIENT_INFO_FILE); if (gradient_data_string != null) { Debug.Log(texture.name + " Gradient loaded from file."); Gradient g = Parser.Deserialize <Gradient>(gradient_data_string); return(g); } Debug.Log(texture.name + " Converted into Gradient."); return(Converter.TextureToGradient(GetReadableTexture(texture))); } return(new Gradient()); }