public async UniTask <IEnumerable <Script> > LoadAllScriptsAsync()
        {
            OnScriptLoadStarted?.Invoke();
            var scriptResources = await scriptLoader.LoadAllAsync();

            var scripts = scriptResources.Select(r => r.Object);

            await UniTask.WhenAll(scripts.Select(s => TryAddLocalizationScriptAsync(s)));

            if (ScriptNavigator)
            {
                ScriptNavigator.GenerateScriptButtons(scripts);
            }

            OnScriptLoadCompleted?.Invoke();
            return(scripts);
        }
Esempio n. 2
0
        public virtual async UniTask <IReadOnlyCollection <Script> > LoadAllScriptsAsync()
        {
            OnScriptLoadStarted?.Invoke();
            var scriptResources = await scriptLoader.LoadAllAsync();

            var scripts = scriptResources.Select(r => r.Object).ToArray();

            await UniTask.WhenAll(scripts.Select(TryAddLocalizationScriptAsync));

            if (ScriptNavigator)
            {
                ScriptNavigator.GenerateScriptButtons(scripts);
            }

            OnScriptLoadCompleted?.Invoke();
            return(scripts);
        }