private void Fail(Exception e, string errorMessageFormat) { Status = PreparerStatus.None; if (m_CallbackSet.OnFailure == null) { throw new Exception(string.Empty, e); } m_CallbackSet.OnFailure( Utility.Text.Format(errorMessageFormat, e), m_Context); }
private void OnLoadInstallerIndexFailure(object context) { Status = PreparerStatus.None; var errorMessage = "Cannot load the index file in the installer path."; if (m_CallbackSet.OnFailure != null) { m_CallbackSet.OnFailure(errorMessage, m_Context); } else { throw new InvalidOperationException(errorMessage); } }
public void Run(AssetServicePrepareCallbackSet callbackSet, object context) { if (Status != PreparerStatus.None) { throw new InvalidOperationException("Preparation already run."); } if (IndexForInstallerLoader == null) { throw new InvalidOperationException("Read-only index loader is not set."); } m_CallbackSet = callbackSet; m_Context = context; Status = PreparerStatus.Running; IndexForInstallerLoader.Load(m_Owner.InstallerIndexPath, new LoadAssetIndexForInstallerCallbackSet { OnFailure = OnLoadInstallerIndexFailure, OnSuccess = OnLoadInstallerIndexSuccess, }, null); }
private void Succeed() { Status = PreparerStatus.Success; m_CallbackSet.OnSuccess?.Invoke(m_Context); }
public Preparer(AssetService owner) { m_Owner = owner; Status = PreparerStatus.None; }
public Preparer(AssetModule owner) { m_Owner = owner; Status = PreparerStatus.None; }