Skip to content

Commit a5f478f

Browse files
committed
UniVRM0.99向け修正
1 parent a79a8b0 commit a5f478f

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

EVMC4U/Editor/Tutorial.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2525
* SOFTWARE.
2626
*/
27+
#pragma warning disable CS0162
2728
using UnityEngine;
2829
using UnityEditor;
2930
using UnityEditor.AnimatedValues;
@@ -37,7 +38,7 @@ public class Tutorial : EditorWindow
3738
static GUIStyle style = new GUIStyle();
3839
static int page = 1;
3940
static AnimFloat anim = new AnimFloat(0.001f);
40-
const bool check = VRMVersion.MAJOR != 0 || VRMVersion.MINOR != 80;
41+
const bool check = VRMVersion.MAJOR != 0 || VRMVersion.MINOR != 99;
4142

4243
[InitializeOnLoadMethod]
4344
static void InitializeOnLoad()

EVMC4U/ExternalReceiver.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace EVMC4U
4444
//[RequireComponent(typeof(uOSC.uOscServer))]
4545
public class ExternalReceiver : MonoBehaviour, IExternalReceiver
4646
{
47-
[Header("ExternalReceiver v3.8")]
47+
[Header("ExternalReceiver v3.9")]
4848
public GameObject Model = null;
4949
public bool Freeze = false; //すべての同期を止める(撮影向け)
5050
public bool PacktLimiter = true; //パケットフレーム数が一定値を超えるとき、パケットを捨てる
@@ -673,12 +673,13 @@ public void LoadVRMFromData(byte[] VRMdata)
673673
//読み込み
674674
GlbLowLevelParser glbLowLevelParser = new GlbLowLevelParser(null, VRMdata);
675675
GltfData gltfData = glbLowLevelParser.Parse();
676-
VRMImporterContext vrmImporter = new VRMImporterContext(gltfData);
676+
VRMData vrm = new VRMData(gltfData);
677+
VRMImporterContext vrmImporter = new VRMImporterContext(vrm);
677678

678679
isLoading = true;
679680

680681
synchronizationContext.Post(async (arg) => {
681-
RuntimeGltfInstance instance = await vrmImporter.LoadAsync();
682+
RuntimeGltfInstance instance = await vrmImporter.LoadAsync(new VRMShaders.ImmediateCaller());
682683
isLoading = false;
683684

684685
Model = instance.Root;
@@ -696,6 +697,10 @@ public void LoadVRMFromData(byte[] VRMdata)
696697
//カメラなどの移動補助のため、頭の位置を格納する
697698
animator = Model.GetComponent<Animator>();
698699
HeadPosition = animator.GetBoneTransform(HumanBodyBones.Head).position;
700+
701+
//開放
702+
vrmImporter.Dispose();
703+
gltfData.Dispose();
699704
}, null);
700705
}
701706

0 commit comments

Comments
 (0)