Пример #1
0
        void CheckForEntriesMissingFromSharedTableData(MissingEntryAction missingEntryAction)
        {
            if (m_TargetTable.SharedData == null)
            {
                return;
            }

            if (m_TargetTable is StringTable stringTable)
            {
                HandleMissingEntriesFromSharedTableData <StringTable, StringTableEntry>(stringTable, missingEntryAction);
            }
            else if (m_TargetTable is AssetTable assetTable)
            {
                HandleMissingEntriesFromSharedTableData <AssetTable, AssetTableEntry>(assetTable, missingEntryAction);
            }
        }
Пример #2
0
        void HandleMissingEntriesFromSharedTableData <T, TEntry>(T table, MissingEntryAction missingEntryAction)
            where T : DetailedLocalizationTable <TEntry>
            where TEntry : TableEntry
        {
            m_MissingSharedDataEntriesWarning = null;
            var missingEntries = table.CheckForMissingSharedTableDataEntries(missingEntryAction);

            if (missingEntryAction != MissingEntryAction.Nothing || missingEntries.Count == 0)
            {
                return;
            }

            using (StringBuilderPool.Get(out var sb))
            {
                sb.Append("This table contains some entries that are missing from Shared Table Data.\nThese entries will be ignored:");
                foreach (var entry in missingEntries)
                {
                    var value = string.IsNullOrEmpty(entry.LocalizedValue) ? "<empty>" : entry.LocalizedValue;
                    sb.Append($"\n{entry.KeyId} - {value}");
                }
                m_MissingSharedDataEntriesWarning = sb.ToString();
            }
        }