public void OnPreprocessBuild(BuildReport report) { BuildTarget target = report.summary.platform; if (target == BuildTarget.iOS || target == BuildTarget.Android) { OpenBackConfig config = OpenBackConfig.Load(); config.Apply(); } }
public static OpenBackConfig Load() { OpenBackConfig config = null; if (File.Exists(configFile)) { try { StreamReader reader = new StreamReader(configFile); var json = reader.ReadToEnd(); config = JsonUtility.FromJson <OpenBackConfig>(json); reader.Close(); } catch (Exception e) { Debug.Log("Unable to load OpenBack config: " + e); } } return(config ?? new OpenBackConfig()); }
void OnEnable() { config = OpenBackConfig.Load(); config.Apply(); }