.IO; ;using System; ; ;public class languageLocalizationManager : MonoBehaviour ;{ ; [Space] ; [Header ("Language Tool Settings")] ; [Space] ; ; public string currentLanguageToEdit = "English"; ; ; public string filePath = "Assets/Game Kit Controller/Scripts/Editor/Resources/"; ; ; public string filePathBuild = "./Localization/"; ; ; public string fileFormat = ".csv"; ; ; public string fileName; ; ; public bool useLocalFilePath; ; ; public bool localizationEnabled = true; ; ; [Space] ; [Header ("Debug")] ; [Space] ; ; public bool showDebugPrint; ; ; [Space] ; [Header ("Event Settings")] ; [Space] ; ; public bool useEventsOnLanguageChange; ; public UnityEvent eventOnLanguageChange; ; ; public virtual void updateFileName () ; { ; ; } ; ; public string getCurrentFilePath () ; { ; if (Application.isEditor && !useLocalFilePath) { ; return filePath; ; } else { ; return filePathBuild; ; } ; } ; ; public bool isUseLocalFilePathActive () ; { ; if (Application.isEditor && !useLocalFilePath) { ; return false; ; } else { ; return true; ; } ; } ; ; public virtual void checkIfLanguageFileExists () ; { ; string currentFiletPath = getCurrentFilePath (); ; ; string newFilePath = currentFiletPath + fileName + fileFormat; ; ; if (showDebugPrint) { ; print ("Checking if " + fileName + " exists on path: " + newFilePath); ; } ; ; if (System.IO.File.Exists (newFilePath)) { ; if (showDebugPrint) { ; print ("File Located"); ; } ; } else { ; if (showDebugPrint) { ; print (newFilePath + " doesn't exist"); ; } ; ; FileStream file = File.Open (newFilePath, FileMode.OpenOrCreate); ; ; file.Close (); ; } ; } ; ; public virtual void checkFileNameValue () ; { ; ; } ; ; public virtual void updateLocalizationFileExternally () ; { ; ; } ; ; public virtual void checkEventsOnLanguageChange () ; { ; if (useEventsOnLanguageChange) { ; eventOnLanguageChange.Invoke (); ; } ; } ; ; public virtual void updateLocalizationFileFromEditor () ; { ; ; } ; ; public virtual void addKey (string key, string value) ; { ; ; } ; ; public virtual void removeKey (string key) ; { ; ; } ; ; public virtual void addLanguage (string languageName) ; { ; ; } ; ; public virtual void addLanguageListToNewLocalizationFile () ; { ; ; } ; ; public virtual Dictionary getDictionaryForEditor () ; { ; ; return null; ; } ; ; public virtual string GetLocalizedValueFromEditor (string key) ; { ; ; return ""; ; } ; ; public void updateComponent () ; { ; GKC_Utils.updateComponent (this); ; ; GKC_Utils.updateDirtyScene ("Update Localization " + gameObject.name, gameObject); ; } ;} ;