Пример #1
0
    public void ReloadThemes()
    {
        if (Application.isEditor && !Application.isPlaying)
        {
            ImageManager.ClearCache();
            AudioManager.ClearCache();
        }

        string lastThemeName = CurrentTheme?.Name;

        themeNameToTheme = new Dictionary <string, Theme>();
        string themesFilePath    = ApplicationUtils.GetStreamingAssetsPath(ThemesFolderName + "/" + ThemesFileName);
        string themesFileContent = File.ReadAllText(themesFilePath);

        ReloadThemesFromXml(themesFileContent);

        // Restore last selected theme
        if (!lastThemeName.IsNullOrEmpty())
        {
            Theme theme = GetTheme(lastThemeName);
            if (theme != null)
            {
                CurrentTheme = theme;
            }
        }
    }
Пример #2
0
    private static string GetPropertiesFilePath(string propertiesFileNameWithCountryCode)
    {
        string path = I18NFolder + "/" + propertiesFileNameWithCountryCode + PropertiesFileExtension;

        path = ApplicationUtils.GetStreamingAssetsPath(path);
        return(path);
    }
Пример #3
0
    private string GetStreamingAssetsPath(string resourceName)
    {
        string resourcePath = ThemeManager.ThemesFolderName + "/" + Name + "/" + resourceName;

        return(ApplicationUtils.GetStreamingAssetsPath(resourcePath));
    }
Пример #4
0
 private static string GetInputActionAssetFilePath()
 {
     return(ApplicationUtils.GetStreamingAssetsPath("Input/UltraStarPlayInputActions.inputactions"));
 }