Allow mocap bodies to be loaded by the Unity plugin.
PiperOrigin-RevId: 558735711 Change-Id: Ibc9a81cbf8ec4b979d5b325c822c1bffc1408509
This commit is contained in:
committed by
Copybara-Service
parent
ed4bb2aab5
commit
ef699d4b6d
@@ -252,7 +252,18 @@ public class MjcfImporter {
|
||||
break;
|
||||
}
|
||||
case "body": {
|
||||
var childObject = CreateGameObjectWithUniqueName<MjBody>(parentObject, child);
|
||||
GameObject childObject = null;
|
||||
const string mocapAttribute = "mocap";
|
||||
if (child.HasAttribute(mocapAttribute)) {
|
||||
var mocapValueStr = child.GetAttribute(mocapAttribute);
|
||||
var mocapValue = bool.Parse(mocapValueStr);
|
||||
if (mocapValue) {
|
||||
childObject = CreateGameObjectWithUniqueName<MjMocapBody>(parentObject, child);
|
||||
}
|
||||
}
|
||||
if (childObject == null) {
|
||||
childObject = CreateGameObjectWithUniqueName<MjBody>(parentObject, child);
|
||||
}
|
||||
ParseBodyChildren(childObject, child);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user