public bool TryLoadConfiguration <T>(string path, out T state) { try { state = _jsonManager.Deserialize <T>(path); return(true); } catch (Exception ex) { Debug.LogWarning(ex); Debug.LogWarning("Can't load configuration!"); state = (T)Activator.CreateInstance(typeof(T)); return(false); } }
public bool TryLoadConfiguration <T>(string path, out T state) { try { state = _jsonManager.Deserialize <T>(path); return(true); } catch (Exception ex) { Debug.LogWarning(ex); Debug.LogWarning("Can't load configuration!"); BootDialog.PostBootDialog.ErrorList.Add("Error in config file: " + ex.Message); state = (T)Activator.CreateInstance(typeof(T)); return(false); } }