From ae8d4db6b989cf1fff324645dfff41616e812bf6 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Mon, 12 Sep 2022 17:55:34 +0900 Subject: [PATCH] Fix bug of null access when loading vrm1.0 prefab placed in the scene. --- .../VRM10/Runtime/Components/Vrm10Runtime/Vrm10Runtime.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10Runtime.cs b/Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10Runtime.cs index 18872aa83..e4c59acec 100644 --- a/Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10Runtime.cs +++ b/Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10Runtime.cs @@ -28,7 +28,12 @@ namespace UniVRM10 private FastSpringBoneBuffer m_fastSpringBoneBuffer; + /// + /// Control Rig may be null. + /// Control Rig is generated at loading runtime only. + /// public Vrm10RuntimeControlRig ControlRig { get; } + public IVrm10Constraint[] Constraints { get; } public Vrm10RuntimeExpression Expression { get; } public Vrm10RuntimeLookAt LookAt { get; } @@ -165,7 +170,7 @@ namespace UniVRM10 public void Process() { // 1. Control Rig - ControlRig.Process(); + ControlRig?.Process(); // 2. Constraints foreach (var constraint in Constraints)