private bool TryLoadLastAppState() { var result = true; try { MaterialState = _stateManager.LoadMaterialColorState(); } catch (Exception e) { Status = "Can't load last material state"; _logger.Log(e); MaterialState = new MaterialColorState(); result = false; } try { OnionState = _stateManager.LoadOnionState(); } catch (Exception e) { Status = "Can't load last onion state"; _logger.Log(e); OnionState = new OnionState(); result = false; } try { TemperatureOverlayState = _stateManager.LoadTemperatureState(); } catch (Exception e) { Status = "Can't load last temperature overlay state"; _logger.Log(e); TemperatureOverlayState = new TemperatureOverlayState(); result = false; } return(result); }
private static bool TryLoadConfig() { try { Config = _stateManager.LoadOnionState(); _logger.Log("OnionState.json loaded"); return(true); } catch { Config = new OnionState(); const string Message = "OnionState.json loading failed"; _logger.Log(Message); Debug.LogError(Message); return(false); } }