Пример #1
0
            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);
            }
Пример #2
0
            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);
                }
            }
Пример #3
0
            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);
            }
Пример #4
0
 private void Succeed()
 {
     Status = PreparerStatus.Success;
     m_CallbackSet.OnSuccess?.Invoke(m_Context);
 }
Пример #5
0
 public Preparer(AssetService owner)
 {
     m_Owner = owner;
     Status  = PreparerStatus.None;
 }
 public Preparer(AssetModule owner)
 {
     m_Owner = owner;
     Status  = PreparerStatus.None;
 }