/// <summary> /// Loads a limapp, all GameObjects under [ExperienceApp] will be inactive until Begin() is called /// </summary> /// <param name="experience"></param> /// <returns></returns> public BundleAsyncLoadOperationBase Load(Experience experience) { Setup(); _loadOperation = _bundleLoader.Load(experience); _loadOperation.Completed += OnAppLoadComplete; return(_loadOperation); }
private void Cancel() { if (_loadOperation != null) { _loadOperation.Completed -= OnAppLoadComplete; _loadOperation.Cancel(); _loadOperation = null; } }
public override void Load(BundleAsyncLoadOperationBase loadingOperation) { gameObject.SetActive(true); if (_LoadingRoutine != null) { StopCoroutine(_LoadingRoutine); } _LoadingRoutine = StartCoroutine(RunLoadingBarCoro(loadingOperation)); }
protected override IEnumerator RunLoadingBarCoro(BundleAsyncLoadOperationBase loadingOperation) { if (!loadingOperation.IsDone) { while (loadingOperation.Progress < 1f) { UpdateLoadingBarProgress(loadingOperation.Progress); yield return(new WaitForEndOfFrame()); } UpdateLoadingBarProgress(1f); } }
protected abstract IEnumerator RunLoadingBarCoro(BundleAsyncLoadOperationBase loadingOperation);
public abstract void Load(BundleAsyncLoadOperationBase loadingOperation);
private void OnAppLoadComplete(BundleAsyncLoadOperationBase operationBase) { operationBase.Completed -= OnAppLoadComplete; ExperienceAppLoaded?.Invoke(operationBase.Experience, operationBase.ExperienceApp); }