Пример #1
0
 private static void MoveMaterialsToNewLocation(string oldPackageRoot)
 {
     if (RuntimeUrdf.AssetDatabase_IsValidFolder(Path.Combine(oldPackageRoot, MaterialFolderName)))
     {
         RuntimeUrdf.AssetDatabase_MoveAsset(
             Path.Combine(oldPackageRoot, MaterialFolderName),
             Path.Combine(UrdfAssetPathHandler.GetPackageRoot(), MaterialFolderName));
     }
     else
     {
         RuntimeUrdf.AssetDatabase_CreateFolder(UrdfAssetPathHandler.GetPackageRoot(), MaterialFolderName);
     }
 }
Пример #2
0
        public static void SetPackageRoot(string newPath, bool correctingIncorrectPackageRoot = false)
        {
            string oldPackagePath = packageRoot;

            packageRoot = GetRelativeAssetPath(newPath);

            if (!RuntimeUrdf.AssetDatabase_IsValidFolder(Path.Combine(packageRoot, MaterialFolderName)))
            {
                RuntimeUrdf.AssetDatabase_CreateFolder(packageRoot, MaterialFolderName);
            }

            if (correctingIncorrectPackageRoot)
            {
                MoveMaterialsToNewLocation(oldPackagePath);
            }
        }
Пример #3
0
 public void AssetDatabase_IsValidFolder_EditorMode()
 {
     RuntimeUrdf.runtimeModeEnabled = false;
     Assert.IsTrue(RuntimeUrdf.AssetDatabase_IsValidFolder("Packages/com.unity.robotics.urdf-importer/Tests/Runtime/RuntimeImport"));
     Assert.IsFalse(RuntimeUrdf.AssetDatabase_IsValidFolder("Packages/com.unity.robotics.urdf-importer/Tests/Runtime/RuntimeImport/Does/Not/Exist"));
 }