示例#1
0
        public void Setup()
        {
            LocalizationSettingsHelper.SaveCurrentSettings();

            m_SharedStringTableData = ScriptableObject.CreateInstance <SharedTableData>();
            m_SharedStringTableData.TableCollectionName     = kStringTableCollectionName;
            m_SharedStringTableData.TableCollectionNameGuid = kStringTableNameGuid;
            m_SharedStringTableData.AddKey(kStringKeyName, kStringKeyId);

            m_SharedAssetTableData = ScriptableObject.CreateInstance <SharedTableData>();
            m_SharedAssetTableData.TableCollectionName     = kAssetTableCollectionName;
            m_SharedAssetTableData.TableCollectionNameGuid = kAssetTableNameGuid;

            m_Settings = LocalizationSettingsHelper.CreateEmpty();
            var stringDb = new LocalizedStringDatabase();

            m_Settings.SetStringDatabase(stringDb);
            var assetDb = new LocalizedAssetDatabase();

            m_Settings.SetAssetDatabase(assetDb);

            var rm = new ResourceManager();

            stringDb.SharedTableDataOperations[kStringTableNameGuid] = rm.CreateCompletedOperation(m_SharedStringTableData, null);
            assetDb.SharedTableDataOperations[kAssetTableNameGuid]   = rm.CreateCompletedOperation(m_SharedAssetTableData, null);

            LocalizationSettings.Instance = m_Settings;
        }