Preliminary support for plugins. Load all plugins in plugin folder.

This commit is contained in:
Bálint Hodossy
2024-02-18 14:45:54 +00:00
parent ab209c41be
commit c65410a92d
4 changed files with 24 additions and 0 deletions
@@ -50,6 +50,7 @@ public class MjImporterWithAssets : MjcfImporter {
// mjcfString.
var name = Path.GetFileNameWithoutExtension(filePath) + $"{UnityEngine.Random.Range(0,999)}";
string newPath = Path.Combine(Application.temporaryCachePath, $"{name}.xml");
MjEngineTool.LoadPlugins();
_mjModel = MjEngineTool.LoadModelFromFile(filePath);
MjEngineTool.SaveModelToFile(newPath, _mjModel);
Debug.Log($"Imported MJCF loaded, saved to {newPath}");