Example #1
0
        public virtual async UniTask ApplyManagedTextAsync()
        {
            records.Clear();
            var documentResources = await documentLoader.LoadAndHoldAllAsync(this);

            foreach (var documentResource in documentResources)
            {
                if (!documentResource.Valid)
                {
                    Debug.LogWarning($"Failed to load `{documentResource.Path}` managed text document.");
                    continue;
                }
                var managedTextSet = ManagedTextUtils.ParseDocument(documentResource.Object.text, documentLoader.GetLocalPath(documentResource));

                foreach (var text in managedTextSet)
                {
                    records.Add(new ManagedTextRecord(text.Key, text.Value, text.Category));
                }

                ManagedTextUtils.ApplyRecords(managedTextSet);
            }
        }