private async UniTask TryAddLocalizationScriptAsync(Script script)
        {
            if (script is null)
            {
                return;
            }
            var fullPath = scriptLoader.BuildFullPath(script.Name);

            if (await localizationManager.LocalizedResourceAvailableAsync <Script>(fullPath))
            {
                var localizationScript = await localizationManager.LoadLocalizedResourceAsync <Script>(fullPath);

                localizationScripts[script.Name] = localizationScript;
            }
        }
Esempio n. 2
0
        public override async UniTask <Resource <TResource> > LoadAsync(string path, bool isFullPath = false)
        {
            if (!isFullPath)
            {
                path = BuildFullPath(path);
            }

            if (LocalizationManager is null || !await LocalizationManager.LocalizedResourceAvailableAsync <TResource>(path))
            {
                return(await base.LoadAsync(path, true));
            }

            var localizedResource = await LocalizationManager.LoadLocalizedResourceAsync <TResource>(path);

            if (localizedResource != null && localizedResource.IsValid)
            {
                LoadedLocalizedResources.Add(localizedResource);
            }
            return(localizedResource);
        }