Пример #1
0
        public void TestAbsoluteToRelative()
        {
            string absPath = UnityPathUtils.Combine(Application.dataPath, "Things/test.txt");
            string relPath = UnityPathUtils.Combine("Assets", "Things/test.txt");

            Assert.That(
                UnityPathUtils.AbsoluteToRelative(absPath),
                Is.EqualTo(relPath)
                );
        }
        public void TestAbsoluteToRelative()
        {
            // Gotta do this because we need consistent directory separators.
            string dataPath = Application.dataPath.Replace('/', Path.DirectorySeparatorChar);
            string basePath = UnityPathUtils.Combine("Things", "test.txt");

            string absPath = UnityPathUtils.Combine(dataPath, basePath);
            string relPath = UnityPathUtils.Combine("Assets", basePath);

            Assert.That(
                UnityPathUtils.AbsoluteToRelative(absPath),
                Is.EqualTo(relPath)
                );
        }