Ejemplo n.º 1
0
    public void StartUpdate()
    {
        Debug.Log("==开始更新==");
        Debug.Log("下载根目录:" + loadRootPath);
        Debug.Log("保存根目录:" + saveRootPath);

        AssetBundle manifestAB;

        if (File.Exists(FilePathTools.manifestPath))
        {
            manifestAB  = AssetBundle.LoadFromFile(FilePathTools.manifestPath);
            oldManifest = manifestAB.LoadAsset <AssetBundleManifest>("AssetBundleManifest");
            manifestAB.Unload(false);
        }
        else
        {
            Debug.Log("-本地没有版本文件-" + FilePathTools.manifestPath);
        }

        //GameMainManager.instance.mono.StartCoroutine(loadMainVerson());
        //下载主版本文件
        string path = FilePathTools.GetDownLoadMainVersonPath(verMainName);

        AssetLoadManager.Instance.LoadAsset <byte[]>(path, (bytes) => {
            Debug.Log("-下载远程版本文件成功-" + path);
            manifestBytes = bytes;


            manifestAB  = AssetBundle.LoadFromMemory(bytes);
            newManifest = manifestAB.LoadAsset <AssetBundleManifest>("AssetBundleManifest");
            manifestAB.Unload(false);
            UpdateFiles();
        }, false);
    }
        static HashSet <string> GetSelectionsBySamples(List <PathPattern> fileSamples, List <PathPattern> dirSamples)
        {
            List <PathPattern> samples = new List <PathPattern>();

            samples.AddRange(fileSamples);
            samples.AddRange(dirSamples);

            HashSet <string> hash = new HashSet <string>();

            for (int i = 0; i < samples.Count; i++)
            {
                PathPattern sample = samples[i];

                if (!Directory.Exists(sample.dir))
                {
                    DebugUtil.LogWarning("The directory isn't  exist : " + sample.dir);
                    continue;
                }

                string[] entries;
                if (i < fileSamples.Count)
                {
                    entries = FilePathTools.SelectEntries(FilePathTools.GetFiles(sample.dir, sample.regex, sample.searchOption), FILTER_META_REGEX);
                }
                else
                {
                    entries = FilePathTools.GetDirectories(sample.dir, sample.regex, sample.searchOption);
                }

                hash.UnionWith(entries);
                DebugUtil.Log("\"" + EditorCommonUtils.NormalizeDirectory(sample.dir) + sample.regex + "\" match " + (i < fileSamples.Count ? "files" : "directories") + " : " + entries.Length);
            }

            return(hash);
        }
Ejemplo n.º 3
0
 private static void Init()
 {
     AssetsManager.Instance.LoadAssetAsync <GameObject>(FilePathTools.getUIPath("GuideManager"), (go) =>
     {
         GameObject.Instantiate(go);
     });
 }
Ejemplo n.º 4
0
    public void update()
    {
        if (multipleView == Multiple)
        {
            return;
        }
        multipleView = Multiple;
        subBundleInfos.Clear();
        if (Multiple)
        {
            List <string> subFolds = FilePathTools.GetSubFoldPaths(FilePathTools.GetFullpathRelativeExport(Path));
            foreach (var subItem in subFolds)
            {
                string shortPath = FilePathTools.GetShortPathRelativeExport(subItem);
                subBundleInfos.Add(new BundleInfo(shortPath, this.BaseBundle, this.releaseMode));
            }

            List <string> filePaths = FilePathTools.GetFilePaths(FilePathTools.GetFullpathRelativeExport(Path));
            foreach (var filePath in filePaths)
            {
                string shortPath = FilePathTools.GetShortPathRelativeExport(filePath);
                subBundleInfos.Add(new BundleInfo(shortPath, this.BaseBundle, this.releaseMode));
            }
        }
    }
Ejemplo n.º 5
0
        public void ChangingWorkingDirectoryShouldImpactPaths()
        {
            string WorkingDirectoryValue = "C:\\Raven\\";

            if (EnvironmentUtils.RunningOnPosix == true)
            {
                WorkingDirectoryValue = Environment.GetEnvironmentVariable("HOME") + @"\";
            }

            var inMemoryConfiguration = new InMemoryRavenConfiguration();

            inMemoryConfiguration.Settings["Raven/WorkingDir"] = WorkingDirectoryValue;
            inMemoryConfiguration.Initialize();

            var basePath         = FilePathTools.MakeSureEndsWithSlash(AppDomain.CurrentDomain.BaseDirectory.ToFullPath());
            var workingDirectory = inMemoryConfiguration.WorkingDirectory;

            Assert.Equal(WorkingDirectoryValue, inMemoryConfiguration.WorkingDirectory);
            Assert.NotEqual(basePath, workingDirectory);
            Assert.True(inMemoryConfiguration.AssembliesDirectory.StartsWith(WorkingDirectoryValue));
            Assert.True(inMemoryConfiguration.CompiledIndexCacheDirectory.StartsWith(WorkingDirectoryValue));
            Assert.True(inMemoryConfiguration.DataDirectory.StartsWith(WorkingDirectoryValue));
            Assert.True(inMemoryConfiguration.FileSystem.DataDirectory.StartsWith(WorkingDirectoryValue));
            Assert.True(inMemoryConfiguration.Counter.DataDirectory.StartsWith(WorkingDirectoryValue));
            Assert.True(inMemoryConfiguration.TimeSeries.DataDirectory.StartsWith(WorkingDirectoryValue));
        }
Ejemplo n.º 6
0
    public void LoadConfig(System.Action onCompalte)
    {
        num = 0;
        string[] keyList = new string[configDic.Keys.Count];
        configDic.Keys.CopyTo(keyList, 0);
        foreach (string key in keyList)
        {
            AssetBundleLoadManager.Instance.LoadAsset <Object>(FilePathTools.getConfigPath(key), (data) =>
            {
                string k    = keyList[num];
                Type type   = configDic[k];
                string json = data.ToString();

                MethodInfo mi            = GetGenericMethod(typeof(JsonMapper), "ToObject", BindingFlags.Public | BindingFlags.Static, typeof(string));
                MethodInfo miConstructed = mi.MakeGenericMethod(type);
                object obj = miConstructed.Invoke(null, new object[] { json });

                this.GetType().GetField(key).SetValue(this, obj);

                num++;
                if (num >= keyList.Length)
                {
                    onCompalte();
                }
            });
        }
    }
Ejemplo n.º 7
0
    public void SetData(PropItem prop, int haveCount, bool isComplate = false)
    {
        string url = FilePathTools.GetPropItemIconPath(prop.icon);

        AssetsManager.Instance.LoadAssetAsync <Sprite>(url, (sp) =>
        {
            img.sprite = sp;
        });
        if (isComplate)
        {
            complateImg.SetActive(true);
            text.text = "";
        }
        else
        {
            complateImg.SetActive(false);
            string str = "";
            if (haveCount < prop.count)
            {
                str = string.Format("<color=red>{0}</color>/{1}", haveCount, prop.count);
            }
            else
            {
                str = haveCount.ToString() + "/" + prop.count.ToString();
            }
            text.text = str;
        }
    }
Ejemplo n.º 8
0
    private void OnLoadAtlas(string tag, Action <SpriteAtlas> act)
    {
        string path = FilePathTools.getSpriteAtlasPath(tag);

        if (GameMainManager.instance.preloader.Contains(path))
        {
            AssetBundle ab = GameMainManager.instance.preloader.GetPreloaderAssetBundle(path);
            SpriteAtlas sa = ab.LoadAsset <SpriteAtlas>(System.IO.Path.GetFileNameWithoutExtension(path));
            act(sa);
            //同一图集只会请求一次,所以用完就卸载掉
            GameMainManager.instance.preloader.RemovePreloaderAssetBundle(this, path);
        }
        else
        {
            Debug.Log("开始加载[" + tag + "]图集");
            SpriteAtlas sa = AssetBundleLoadManager.Instance.Load <SpriteAtlas>(path);
            act(sa);
            Debug.Log("图集加载完毕:" + sa);
        }

        //canvasScaler.enabled = false;
        //canvas.enabled = false;

        //canvasScaler.enabled = true;
        //canvas.enabled = true;
    }
Ejemplo n.º 9
0
        public HttpResponseMessage Delete(string name)
        {
            name = RavenFileNameHelper.RavenPath(name);

            try
            {
                ConcurrencyAwareExecutor.Execute(() => Storage.Batch(accessor =>
                {
                    AssertFileIsNotBeingSynced(name, accessor, true);

                    var fileAndPages = accessor.GetFile(name, 0, 0);

                    var metadata = fileAndPages.Metadata;

                    if (metadata.Keys.Contains(SynchronizationConstants.RavenDeleteMarker))
                    {
                        throw new FileNotFoundException();
                    }

                    StorageOperationsTask.IndicateFileToDelete(name);

                    if (!name.EndsWith(RavenFileNameHelper.DownloadingFileSuffix) &&
                        // don't create a tombstone for .downloading file
                        metadata != null)                             // and if file didn't exist
                    {
                        var tombstoneMetadata = new RavenJObject
                        {
                            {
                                SynchronizationConstants.RavenSynchronizationHistory, metadata[SynchronizationConstants.RavenSynchronizationHistory]
                            },
                            {
                                SynchronizationConstants.RavenSynchronizationVersion, metadata[SynchronizationConstants.RavenSynchronizationVersion]
                            },
                            {
                                SynchronizationConstants.RavenSynchronizationSource, metadata[SynchronizationConstants.RavenSynchronizationSource]
                            }
                        }.WithDeleteMarker();

                        Historian.UpdateLastModified(tombstoneMetadata);

                        accessor.PutFile(name, 0, tombstoneMetadata, true);
                        accessor.DeleteConfig(RavenFileNameHelper.ConflictConfigNameForFile(name));
                        // delete conflict item too
                    }
                }), ConcurrencyResponseException);
            }
            catch (FileNotFoundException)
            {
                return(new HttpResponseMessage(HttpStatusCode.NotFound));
            }

            Publisher.Publish(new FileChangeNotification {
                File = FilePathTools.Cannoicalise(name), Action = FileChangeAction.Delete
            });
            log.Debug("File '{0}' was deleted", name);

            StartSynchronizeDestinationsInBackground();

            return(GetEmptyMessage(HttpStatusCode.NoContent));
        }
Ejemplo n.º 10
0
 private void PublishFileNotification(string fileName, FileChangeAction action)
 {
     Publisher.Publish(new FileChangeNotification
     {
         File   = FilePathTools.Cannoicalise(fileName),
         Action = action
     });
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 判断是不是固定打包资源
 /// </summary>
 /// <returns><c>true</c>, if fixed build asset was ised, <c>false</c> otherwise.</returns>
 /// <param name="path">相对地址.</param>
 static bool isFixedBuildAsset(string path)
 {
     if (path.IndexOf(FilePathTools.getRelativePath(buildRootPath)) == -1)
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 12
0
 public static void TestBuildAllAsset()
 {
     Debug.Log("开始打包");
     AssetDatabase.SaveAssets();
     AssetBundleBuild[] buildMap = GetBuildFileListNew(buildRootPath);
     FilePathTools.createFolder(exportPath);
     BuildPipeline.BuildAssetBundles(exportPath, buildMap, BuildAssetBundleOptions.DeterministicAssetBundle, buildTarget);
     Debug.Log("打包完毕");
 }
Ejemplo n.º 13
0
    private void SetBuildingState(int index, int state, Sprite ruinsSprite)
    {
        if (index == 2 || index == 3)//排除动物和载具
        {
            return;
        }
        //状态值 0正常 1损坏 2摧毁
        if (effects != null && ruins != null && index < citySprites.Length)
        {
            if (effects[index] != null)
            {
                effects[index].SetActive(false);
            }
            if (ruins[index] != null)
            {
                ruins[index].gameObject.SetActive(false);
            }

            if (state == 1)
            {
                if (effects[index] != null)
                {
                    effects[index].SetActive(true);
                }
                else
                {
                    string path = FilePathTools.getEffectPath("SmokeLight");
                    AssetBundleLoadManager.Instance.LoadAsset <GameObject>(path, (go) => {
                        GameObject effect = GameUtils.createGameObject(citySprites[index].transform.GetChild(0).gameObject, go);
                        Quaternion q      = Quaternion.identity;
                        q.eulerAngles     = new Vector3(-90, 0, 0);
                        effect.transform.localRotation = q;
                        effect.transform.localPosition = new Vector3(0, 50, -100);
                        effects[index] = effect;
                    });
                }
            }
            else if (state == 2)
            {
                if (ruins[index] != null)
                {
                    ruins[index].gameObject.SetActive(true);
                }
                else
                {
                    GameObject ruinsGo = GameUtils.createGameObject(citySprites[index].transform.GetChild(0).gameObject, "ruins");
                    ruins[index]        = ruinsGo.AddComponent <Image>();
                    ruins[index].sprite = ruinsSprite;
                    ruins[index].SetNativeSize();
                }
            }
            else
            {
            }
        }
    }
Ejemplo n.º 14
0
    public IEnumerator LoadAssetAsync <T>(string url, Action <T> callback) where T : Object
    {
        string path = url;

        string localPath = CacheManager.instance.GetLocalPath(url);

        if (!string.IsNullOrEmpty(localPath))
        {
            path = localPath;
        }
        //Debug.Log("==开始使用WWW下载==:" + path);

        path = FilePathTools.normalizePath(path);
        WWW www = new WWW(path);

        yield return(www);

        if (string.IsNullOrEmpty(www.error))
        {
            object res;
            Type   type = typeof(T);
            if (type == typeof(Texture2D))
            {
                Texture2D tex = new Texture2D(4, 4);
                www.LoadImageIntoTexture(tex);
                res = tex;
            }
            else if (type == typeof(AssetBundle))
            {
                res = www.assetBundle;
            }
            else if (type == typeof(string))
            {
                res = www.text;
            }
            else if (type == typeof(TextAsset))
            {
                res = www.text;
            }
            else
            {
                res = www.bytes;
            }

            CacheManager.instance.AddCache(url, www.bytes);

            www.Dispose();
            callback((T)res);
        }
        else
        {
            Debug.Log(url);
            Debug.Log(www.error);
            www.Dispose();
        }
    }
Ejemplo n.º 15
0
    public void LoadAssetWithWWW(string url, Action <WWW> callback)
    {
        string path = url;

        path = FilePathTools.normalizePath(path);
        queue.Enqueue(() =>
        {
            TryClearCache();
            StartCoroutine(LoadWithWWW(url, callback));
        });
    }
Ejemplo n.º 16
0
        protected RavenTestBase()
        {
            Environment.SetEnvironmentVariable(Constants.RavenDefaultQueryTimeout, "30");
            CommonInitializationUtil.Initialize();

            // Make sure to delete the Data folder which we be used by tests that do not call the NewDataPath from whatever reason.
            var dataFolder = FilePathTools.MakeSureEndsWithSlash(@"~\Data".ToFullPath());

            ClearDatabaseDirectory(dataFolder);
            pathsToDelete.Add(dataFolder);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 获取XML文件根节点
        /// </summary>
        /// <param name="filePath">文件名称</param>
        /// <param name="isRequest">是否是客户端请求</param>
        /// <returns></returns>
        public XElement GetRootElement(string filePath, bool isRequest = true)
        {
            var physicalPath = FilePathTools.GetFilePhysicalPath(filePath, isRequest);

            if (!File.Exists(physicalPath))
            {
                throw new Exception("文件不存在");
            }
            XDocument xDoc = XDocument.Load(physicalPath);

            return(xDoc.Root);
        }
Ejemplo n.º 18
0
    /// <summary>
    /// 加载一个本地资源(file)
    /// </summary>
    /// <param name="path"></param>
    public void LoadAsset <T>(string url, Action <T> callback, bool isCache = true)
    {
        string path = url;

        path = FilePathTools.normalizePath(path);
        //为了保证后请求的图片就在后面刷新,避免列表复用时下载没结束被新的缓存图片覆盖,加载结束又被之前的图片覆盖掉,这里即使有缓存图片也要加入队列排队
        queue.Enqueue(() =>
        {
            TryClearCache();
            StartCoroutine(loadAsync <T>(path, callback, isCache));
        });
    }
Ejemplo n.º 19
0
        private void Load <T>(Action onComplate) where T : BaseConfig, new()
        {
            allCount++;
            T      config = new T();
            string path   = FilePathTools.getXmlPath(config.Name());

            Debug.Log("加载配置文件:" + path);

            AssetsManager.Instance.LoadAssetWithWWW(path, (www) =>
            {
                config.Read(www.text);
                dic.Add(typeof(T), config);
                onComplate();
            });
        }
Ejemplo n.º 20
0
        public void CanUseAppDrivePrefixInWorkingDirectoryForAutoDriveLetterCalculations()
        {
            const string WorkingDirectoryValue = "appDrive:\\Raven\\";
            var          inMemoryConfiguration = new InMemoryRavenConfiguration();

            inMemoryConfiguration.Settings["Raven/WorkingDir"] = WorkingDirectoryValue;
            inMemoryConfiguration.Initialize();

            var basePath         = FilePathTools.MakeSureEndsWithSlash(AppDomain.CurrentDomain.BaseDirectory.ToFullPath());
            var rootPath         = Path.GetPathRoot(basePath);
            var workingDirectory = inMemoryConfiguration.WorkingDirectory;

            Assert.NotEqual(basePath, workingDirectory);
            Assert.True(workingDirectory.StartsWith(rootPath));
        }
Ejemplo n.º 21
0
        public void NotChangingWorkingDirectoryShouldNotImpactPaths()
        {
            var inMemoryConfiguration = new InMemoryRavenConfiguration();

            inMemoryConfiguration.Initialize();

            var basePath         = FilePathTools.MakeSureEndsWithSlash(AppDomain.CurrentDomain.BaseDirectory.ToFullPath());
            var workingDirectory = inMemoryConfiguration.WorkingDirectory;

            Assert.Equal(basePath, workingDirectory);
            Assert.True(inMemoryConfiguration.AssembliesDirectory.StartsWith(basePath));
            Assert.True(inMemoryConfiguration.CompiledIndexCacheDirectory.StartsWith(basePath));
            Assert.True(inMemoryConfiguration.CountersDataDirectory.StartsWith(basePath));
            Assert.True(inMemoryConfiguration.DataDirectory.StartsWith(basePath));
            Assert.True(inMemoryConfiguration.FileSystem.DataDirectory.StartsWith(basePath));
        }
Ejemplo n.º 22
0
        private void OnLoadAtlas(string tag, Action <SpriteAtlas> act)
        {
            string path = FilePathTools.getSpriteAtlasPath(tag);

            Debug.Log("开始加载[" + tag + "]图集");
            SpriteAtlas sa = AssetsManager.Instance.LoadAsset <SpriteAtlas>(path);

            act(sa);
            Debug.Log("图集加载完毕:" + sa);

            //canvasScaler.enabled = false;
            //canvas.enabled = false;

            //canvasScaler.enabled = true;
            //canvas.enabled = true;
        }
Ejemplo n.º 23
0
        private static void LegacyDataDirSupport(RavenConfiguration configuration)
        {
            if (System.IO.Directory.Exists(configuration.Core.DataDirectory))
            {
                return;
            }

            var directory = FilePathTools.ApplyWorkingDirectoryToPathAndMakeSureThatItEndsWithSlash(configuration.Core.WorkingDirectory, "~\\Data");

            if (System.IO.Directory.Exists(directory) == false)
            {
                return;
            }

            configuration.Core.DataDirectory = "~\\Data";
        }
Ejemplo n.º 24
0
        protected RavenTestBase()
        {
            if (checkedAsyncVoid == false)
            {
                checkedAsyncVoid = true;
                AssertNoAsyncVoidMethods(GetType().Assembly);
            }

            Environment.SetEnvironmentVariable(Constants.RavenDefaultQueryTimeout, "30");
            CommonInitializationUtil.Initialize();

            // Make sure to delete the Data folder which we be used by tests that do not call the NewDataPath from whatever reason.
            var dataFolder = FilePathTools.MakeSureEndsWithSlash(@"~\Databases".ToFullPath());

            ClearDatabaseDirectory(dataFolder);
            pathsToDelete.Add(dataFolder);
        }
Ejemplo n.º 25
0
    /// <summary>
    /// 通过相对地址获取assetbundle的名字
    /// </summary>
    /// <returns>The asset bundle name with path.</returns>
    /// <param name="path">相对地址.</param>
    static string getAssetBundleNameWithPath(string path)
    {
        string p = Path.GetDirectoryName(path) + "/" + Path.GetFileNameWithoutExtension(path);

        //判断是依赖资源还是固定资源
        if (!isFixedBuildAsset(p))
        {
            p = FilePathTools.replaceFirst(p, "Assets", "Dependencie");
            //p = p.Replace ("Assets","Dependencie");
        }
        else
        {
            p = FilePathTools.replaceFirst(p, FilePathTools.getRelativePath(buildRootPath) + "/", "");
            //p = p.Replace (buildRoot + "/","");
        }
        return(p);
    }
Ejemplo n.º 26
0
        public void ChangingWorkingDirectoryShouldNotImpactUNCPaths()
        {
            const string WorkingDirectoryValue = "C:\\Raven\\";
            var          inMemoryConfiguration = new InMemoryRavenConfiguration();

            inMemoryConfiguration.Settings["Raven/WorkingDir"] = WorkingDirectoryValue;
            inMemoryConfiguration.Settings["Raven/DataDir"]    = @"\\server1\ravendb\data";
            inMemoryConfiguration.Settings[Constants.FileSystem.DataDirectory] = @"\\server1\ravenfs\data";
            inMemoryConfiguration.Initialize();

            var basePath         = FilePathTools.MakeSureEndsWithSlash(AppDomain.CurrentDomain.BaseDirectory.ToFullPath());
            var workingDirectory = inMemoryConfiguration.WorkingDirectory;

            Assert.Equal(WorkingDirectoryValue, inMemoryConfiguration.WorkingDirectory);
            Assert.NotEqual(basePath, workingDirectory);
            Assert.True(inMemoryConfiguration.DataDirectory.StartsWith(@"\\"));
            Assert.True(inMemoryConfiguration.FileSystem.DataDirectory.StartsWith(@"\\"));
        }
Ejemplo n.º 27
0
        public void RenameFile(RenameFileOperation operation)
        {
            var configName = RavenFileNameHelper.RenameOperationConfigNameForFile(operation.Name);

            notificationPublisher.Publish(new FileChangeNotification
            {
                File   = FilePathTools.Cannoicalise(operation.Name),
                Action = FileChangeAction.Renaming
            });

            storage.Batch(accessor =>
            {
                var previousRenameTombstone = accessor.ReadFile(operation.Rename);

                if (previousRenameTombstone != null &&
                    previousRenameTombstone.Metadata[SynchronizationConstants.RavenDeleteMarker] != null)
                {
                    // if there is a tombstone delete it
                    accessor.Delete(previousRenameTombstone.FullPath);
                }

                accessor.RenameFile(operation.Name, operation.Rename, true);
                accessor.UpdateFileMetadata(operation.Rename, operation.MetadataAfterOperation);

                // copy renaming file metadata and set special markers
                var tombstoneMetadata = new RavenJObject(operation.MetadataAfterOperation).WithRenameMarkers(operation.Rename);

                accessor.PutFile(operation.Name, 0, tombstoneMetadata, true); // put rename tombstone

                accessor.DeleteConfig(configName);

                search.Delete(operation.Name);
                search.Index(operation.Rename, operation.MetadataAfterOperation);
            });

            notificationPublisher.Publish(new ConfigurationChangeNotification {
                Name = configName, Action = ConfigurationChangeAction.Set
            });
            notificationPublisher.Publish(new FileChangeNotification
            {
                File   = FilePathTools.Cannoicalise(operation.Rename),
                Action = FileChangeAction.Renamed
            });
        }
Ejemplo n.º 28
0
        private static string CalculateWorkingDirectory(string workingDirectory)
        {
            if (string.IsNullOrEmpty(workingDirectory))
            {
                workingDirectory = @"~\";
            }

            if (workingDirectory.StartsWith("APPDRIVE:", StringComparison.OrdinalIgnoreCase))
            {
                var baseDirectory = AppContext.BaseDirectory;
                var rootPath      = Path.GetPathRoot(baseDirectory);
                if (string.IsNullOrEmpty(rootPath) == false)
                {
                    workingDirectory = Regex.Replace(workingDirectory, "APPDRIVE:", rootPath.TrimEnd('\\'), RegexOptions.IgnoreCase);
                }
            }

            return(FilePathTools.MakeSureEndsWithSlash(workingDirectory.ToFullPath()));
        }
Ejemplo n.º 29
0
        public void ChangingWorkingDirectoryShouldImpactPaths()
        {
            const string WorkingDirectoryValue = "C:\\Raven\\";
            var          inMemoryConfiguration = new InMemoryRavenConfiguration();

            inMemoryConfiguration.Settings["Raven/WorkingDir"] = WorkingDirectoryValue;
            inMemoryConfiguration.Initialize();

            var basePath         = FilePathTools.MakeSureEndsWithSlash(AppDomain.CurrentDomain.BaseDirectory.ToFullPath());
            var workingDirectory = inMemoryConfiguration.WorkingDirectory;

            Assert.Equal(WorkingDirectoryValue, inMemoryConfiguration.WorkingDirectory);
            Assert.NotEqual(basePath, workingDirectory);
            Assert.True(inMemoryConfiguration.AssembliesDirectory.StartsWith(WorkingDirectoryValue));
            Assert.True(inMemoryConfiguration.CompiledIndexCacheDirectory.StartsWith(WorkingDirectoryValue));
            Assert.True(inMemoryConfiguration.CountersDataDirectory.StartsWith(WorkingDirectoryValue));
            Assert.True(inMemoryConfiguration.DataDirectory.StartsWith(WorkingDirectoryValue));
            Assert.True(inMemoryConfiguration.FileSystem.DataDirectory.StartsWith(WorkingDirectoryValue));
        }
Ejemplo n.º 30
0
 protected override void StartShowWindow(object[] data)
 {
     userData = GameMainManager.instance.model.userData;
     if (spriteAtlas != null && userData.islandId == islandID)
     {
         updateData(spriteAtlas);
     }
     else
     {
         islandID = userData.islandId;
         if (islandID > GameMainManager.instance.configManager.islandConfig.islandNames.Length)
         {
             islandID = islandID % (GameMainManager.instance.configManager.islandConfig.islandNames.Length + 1) + 1;
         }
         string name = "CityThumbnail_" + islandID.ToString();
         string path = FilePathTools.getSpriteAtlasPath(name);
         AssetBundleLoadManager.Instance.LoadAsset <SpriteAtlas>(path, (sa) => {
             spriteAtlas = sa;
             updateData(sa);
         });
     }
 }