private static string GenerateSeparateTextureURL(UFile originalLocation, string suffixName)
 {
     return originalLocation.GetDirectory() + "/" + SplittedTextureNamePrefix + originalLocation.GetFileName() + suffixName;
 }
Esempio n. 2
0
 public void TestWithSimplePathWithExtension()
 {
     var assetPath = new UFile("/a/b/c.txt");
     Assert.AreEqual("/a/b", assetPath.GetDirectory());
     Assert.AreEqual("c", assetPath.GetFileName());
     Assert.AreEqual(".txt", assetPath.GetFileExtension());
     Assert.AreEqual("/a/b/c", assetPath.GetDirectoryAndFileName());
     Assert.AreEqual("/a/b/c.txt", assetPath.FullPath);
 }
Esempio n. 3
0
        public void TestWithNormalization()
        {
            var assetPath = new UFile("/a/b/.././././//c.txt");
            Assert.AreEqual("/a", assetPath.GetDirectory());
            Assert.AreEqual("c", assetPath.GetFileName());
            Assert.AreEqual(".txt", assetPath.GetFileExtension());
            Assert.AreEqual("/a/c", assetPath.GetDirectoryAndFileName());
            Assert.AreEqual("/a/c.txt", assetPath.FullPath);

            assetPath = new UFile("../.././././//c.txt");
            Assert.AreEqual("../..", assetPath.GetDirectory());
            Assert.AreEqual("c", assetPath.GetFileName());
            Assert.AreEqual(".txt", assetPath.GetFileExtension());
            Assert.AreEqual("../../c", assetPath.GetDirectoryAndFileName());
            Assert.AreEqual("../../c.txt", assetPath.FullPath);

            assetPath = new UFile("a/../../../c.txt");
            Assert.AreEqual("../../c.txt", assetPath.FullPath);
        }
Esempio n. 4
0
        public void TestIsDirectoryOnly()
        {
            var dirPath = new UDirectory("/a/b/c");
            Assert.AreEqual("/a/b/c", dirPath.GetDirectory());

            var filePath = new UFile("/test.txt");
            Assert.AreEqual("/", filePath.GetDirectory());
            Assert.AreEqual("test.txt", filePath.GetFileNameWithExtension());
        }