mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-06-02 22:14:30 -05:00
Merge pull request #1624 from ousttrue/fix10/constraint_nullable
constraint の nullable 項目のインポート対応。
This commit is contained in:
commit
0eb7259dc4
|
|
@ -686,24 +686,24 @@ namespace UniVRM10
|
||||||
{
|
{
|
||||||
var roll = constraint.Roll;
|
var roll = constraint.Roll;
|
||||||
var component = node.gameObject.AddComponent<Vrm10RollConstraint>();
|
var component = node.gameObject.AddComponent<Vrm10RollConstraint>();
|
||||||
component.Source = Nodes[roll.Source.Value];
|
component.Source = Nodes[roll.Source.Value]; // required
|
||||||
component.Weight = roll.Weight.Value;
|
component.Weight = roll.Weight.GetValueOrDefault(1.0f);
|
||||||
component.RollAxis = roll.RollAxis;
|
component.RollAxis = roll.RollAxis; // required
|
||||||
}
|
}
|
||||||
else if (constraint.Aim != null)
|
else if (constraint.Aim != null)
|
||||||
{
|
{
|
||||||
var aim = constraint.Aim;
|
var aim = constraint.Aim;
|
||||||
var component = node.gameObject.AddComponent<Vrm10AimConstraint>();
|
var component = node.gameObject.AddComponent<Vrm10AimConstraint>();
|
||||||
component.Source = Nodes[aim.Source.Value];
|
component.Source = Nodes[aim.Source.Value]; // required
|
||||||
component.Weight = aim.Weight.Value;
|
component.Weight = aim.Weight.GetValueOrDefault(1.0f);
|
||||||
component.AimAxis = aim.AimAxis;
|
component.AimAxis = aim.AimAxis; // required
|
||||||
}
|
}
|
||||||
else if (constraint.Rotation != null)
|
else if (constraint.Rotation != null)
|
||||||
{
|
{
|
||||||
var rotation = constraint.Rotation;
|
var rotation = constraint.Rotation;
|
||||||
var component = node.gameObject.AddComponent<Vrm10RotationConstraint>();
|
var component = node.gameObject.AddComponent<Vrm10RotationConstraint>();
|
||||||
component.Source = Nodes[rotation.Source.Value];
|
component.Source = Nodes[rotation.Source.Value]; // required
|
||||||
component.Weight = rotation.Weight.Value;
|
component.Weight = rotation.Weight.GetValueOrDefault(1.0f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user