public override void OnStateEnter() { base.OnStateEnter(); MetaData MetaData = GameSettings.MetaDataAsset.Meta; CreateMetaDataSignal.CreateMetaData(SignalBus, MetaData).Then( () => { _staticDataModel.SeedMetaData(MetaData); BootstrapModel.LoadingProgress.Value = BootstrapModel.ELoadingProgress.LoadUserData; } ).Catch(e => { Debug.LogError("Exception Creating new Meta: " + e.ToString()); }); }
// For now just loading everything from StreamingAssets. Proper way would be loading it from AssetBudles. private IPromise LoadMetaJson(string metaFileName) { Promise promiseReturn = new Promise(); try { string path = Path.Combine(Application.streamingAssetsPath, metaFileName); StreamReader reader = new StreamReader(path); MetaData metaData = JsonConvert.DeserializeObject <MetaData>(reader.ReadToEnd()); reader.Close(); _staticDataModel.SeedMetaData(metaData); promiseReturn.Resolve(); } catch (Exception ex) { promiseReturn.Reject(ex); } return(promiseReturn); }