From b8e01b386025d4abc69ea74fba36db7166153216 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 10 Mar 2020 13:29:15 +0900 Subject: [PATCH] =?UTF-8?q?Bvh=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=81=BF?= =?UTF-8?q?=E3=81=AE=20float.parse=20=E3=81=AB=E3=80=80System.Globalizatio?= =?UTF-8?q?n.CultureInfo.InvariantCulture)=20=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://docs.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.invariantculture?view=netframework-4.8 ロケールを無視して英語で処理するぽい。小数点が、ピリオドでないロケール(フランス語など)に対する修正。 --- Assets/VRM/UniHumanoid/Scripts/Format/Bvh.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/VRM/UniHumanoid/Scripts/Format/Bvh.cs b/Assets/VRM/UniHumanoid/Scripts/Format/Bvh.cs index b7f8e6480..6c39c3b8f 100644 --- a/Assets/VRM/UniHumanoid/Scripts/Format/Bvh.cs +++ b/Assets/VRM/UniHumanoid/Scripts/Format/Bvh.cs @@ -114,7 +114,7 @@ namespace UniHumanoid throw new BvhException("OFFSET is not found"); } - var offset = split.Skip(1).Where(x => !string.IsNullOrEmpty(x)).Select(x => float.Parse(x)).ToArray(); + var offset = split.Skip(1).Where(x => !string.IsNullOrEmpty(x)).Select(x => float.Parse(x, System.Globalization.CultureInfo.InvariantCulture)).ToArray(); return new Single3(offset[0], offset[1], offset[2]); } @@ -320,7 +320,7 @@ namespace UniHumanoid } for(int i=0; i