Beispiel #1
0
    private void SetupConfig(ref FileConfig config)
    {
        FileLink[] links = config.Links;
        for (int i = 0; i < links.Length; i++)
        {
            links[i].Local = Guid.NewGuid().ToString() + UnityPath.GetExtension(links[i].Streaming);
        }

        config.Links      = links;
        config.FirstSetup = false;

        SerializeConfigFile(config);
    }
Beispiel #2
0
    public IEnumerator Action()
    {
        IsDone   = false;
        Progress = 0.0f;

        string configFilePath = PlayerPrefs.GetString(localPathKey);

        if (string.IsNullOrEmpty(configFilePath))
        {
            string streamingPath   = UnityPath.Combinate(Constants.ConfigFilePath, UnityPath.AssetPath.StreamingAsset);
            string localConfigPath =
                UnityPath.GetDirectory(Constants.ConfigFilePath) + @"\" +
                Guid.NewGuid().ToString() +
                UnityPath.GetExtension(Constants.ConfigFilePath);

            yield return(CopyAssets.Copy
                             (streamingPath, UnityPath.Combinate(localConfigPath, UnityPath.AssetPath.Persistent)));

            PlayerPrefs.SetString(localPathKey, localConfigPath);
        }
        IsDone   = true;
        Progress = 1.0f;
    }