static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
        {
            TextAsset[] files = LocalizationConfig.GetResourceFiles();

            if (files == null)
            {
                return;
            }

            string[] paths = new string[files.Length];

            for (int i = 0; i < files.Length; i++)
            {
                paths[i] = AssetDatabase.GetAssetPath(files[i]);
            }

            bool shouldRegenerate = MatchesAny(paths, importedAssets) ||
                                    MatchesAny(paths, deletedAssets) ||
                                    MatchesAny(paths, movedAssets) ||
                                    MatchesAny(paths, movedFromAssetPaths);

            if (shouldRegenerate && LocalizationConfig.AutoGenerateLanguageClass)
            {
                ParseAndBuildLanguageClass(files);
            }
        }
Exemple #2
0
        void TryCreateFile()
        {
            if (p_autoGenerateLanguageClass.boolValue && p_translationFiles.arraySize > 0)
            {
                LanguageGenerator.ParseAndBuildLanguageClass(LocalizationConfig.GetResourceFiles());
            }
            else
            {
                if (File.Exists(LanguageGenerator.filePath))
                {
                    File.Delete(LanguageGenerator.filePath);
                }

                AssetDatabase.Refresh();
            }
        }