protected AbstractBundle(IBundleData bundledata, Framework framework) { resolveState = ResolveState.Unresolved; state = BundleState.Installed; this.bundledata = (BaseData)bundledata; this.bundledata.SetBundle(this); this.framework = framework; statechangeLock = new AutoResetEvent(true); }
public CustomYieldInstruction Initialize(ILoadOperator loadOperator, int maxDownloadCount, int maxLoadCount, Action onSuccess, Action <Exception> onFail) { Log.Debug("[ilib-abloader] Initialize {0}.", loadOperator); bool complete = false; var wait = new WaitUntil(() => complete); //起動済みの際はリセットを先にする必要がある if (State != ABLoaderState.None) { complete = true; Log.Error("[ilib-abloader] already initialized. use ABLoader.Stop()"); onFail?.Invoke(new InvalidOperationException("already initialized. use ABLoader.Stop()")); return(wait); } State = ABLoaderState.Initialize; Cache.Init(loadOperator); m_LoadOperator = loadOperator; m_Downloader = new RequestHander <DownloadRequest>(maxDownloadCount); m_Loader = new RequestHander <LoadOperation>(maxLoadCount); #if UNITY_EDITOR if (ABLoader.UseEditorAsset) { Log.Debug("[ilib-abloader] use editor asset mode."); State = ABLoaderState.Active; onSuccess?.Invoke(); complete = true; return(wait); } #endif var initializer = m_LoadOperator.Init(); initializer.AddCompleteEvent((data, ex) => { complete = true; if (ex != null) { State = ABLoaderState.Error; onFail(ex); } else if (data != null) { State = ABLoaderState.Active; m_BundleData = data; onSuccess?.Invoke(); } }); initializer.DoStart(); return(wait); }
/// <summary> /// 根据插件数据对象创建插件对象 /// </summary> /// <param name="bundledata"></param> /// <param name="framework"></param> /// <param name="isSetBundle"></param> /// <returns></returns> internal static AbstractBundle CreateBundle(IBundleData bundledata, Framework framework, bool isSetBundle) { AbstractBundle result; if (bundledata.BundleType == BundleType.Fragment) { result = new BundleFragment(bundledata, framework); } else { result = new BundleHost(bundledata, framework); } if (isSetBundle) { bundledata.SetBundle(result); } return(result); }
public BundleFragment(IBundleData bundledata, Framework framework) : base(bundledata, framework) { hosts = null; }
protected void Success(IBundleData data) { m_onComplete(data, null); }
public ProductionService(IBundleData bundleData, IPolicyData policyData, IProductData productData) { bundleDataAccess = bundleData; policyDataAccess = policyData; productDataAccess = productData; }
public BundleHost(IBundleData bundledata, Framework framework) : base(bundledata, framework) { context = null; fragments = null; }