Skip to content

Commit 85d8b42

Browse files
committed
VRM1対応
1 parent bc9161f commit 85d8b42

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

EVMC4U/ExternalReceiver.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace EVMC4U
4343
//[RequireComponent(typeof(uOSC.uOscServer))]
4444
public class ExternalReceiver : MonoBehaviour, IExternalReceiver
4545
{
46-
[Header("ExternalReceiver v4.1")]
46+
[Header("ExternalReceiver v5.0")]
4747
[SerializeField, Label("VRMモデルのGameObject")]
4848
public GameObject Model = null;
4949
[SerializeField, Label("一時停止")]
@@ -141,6 +141,8 @@ public class ExternalReceiver : MonoBehaviour, IExternalReceiver
141141
public string loadedVRMName = ""; //読み込み済みVRM名前
142142
[SerializeField, Label("読み込んだモデルの親GameObject")]
143143
public GameObject LoadedModelParent = null; //読み込んだモデルの親
144+
[SerializeField, Label("読み込んだVRMの種別")]
145+
public string loadedVRMType = ""; //読み込んだ種別
144146

145147
[SerializeField, Label("1フレームあたりのパケットフレーム数")]
146148
public int LastPacketframeCounterInFrame = 0; //1フレーム中に受信したパケットフレーム数
@@ -488,6 +490,23 @@ public void Process()
488490
//以降、VrmRootV1 is not nullでVRM1と扱うことができる
489491
}
490492

493+
//判定
494+
if (blendShapeProxyV0 != null && VrmRootV1 != null)
495+
{
496+
loadedVRMType = "VRM0&1";
497+
}
498+
else if (blendShapeProxyV0 != null)
499+
{
500+
loadedVRMType = "VRM0";
501+
}
502+
else if (VrmRootV1 != null)
503+
{
504+
loadedVRMType = "VRM1";
505+
}
506+
else {
507+
loadedVRMType = "Unknown";
508+
}
509+
491510
//ルート位置がない場合
492511
if (RootPositionTransform == null && Model != null)
493512
{
@@ -505,6 +524,8 @@ public void Process()
505524
//モデルがない場合はエラー表示をしておく(親切心)
506525
if (Model == null)
507526
{
527+
blendShapeProxyV0 = null;
528+
VrmRootV1 = null;
508529
StatusMessage = "Model not found.";
509530
return;
510531
}

0 commit comments

Comments
 (0)