@@ -54,40 +54,6 @@ public static class VRMModels
5454 public static Dictionary < Player , string > PlayerToNameDic = new Dictionary < Player , string > ( ) ;
5555 }
5656
57- [ HarmonyPatch ( typeof ( VisEquipment ) , "SetRightHandEquiped" ) ]
58- static class Patch_VisEquipment_SetRightHandEquiped
59- {
60- [ HarmonyPostfix ]
61- static void Postfix ( VisEquipment __instance )
62- {
63- if ( ! __instance . m_isPlayer ) return ;
64-
65- var player = __instance . GetComponent < Player > ( ) ;
66- if ( player == null || ! VRMModels . PlayerToVrmDic . ContainsKey ( player ) ) return ;
67-
68- var name = VRMModels . PlayerToNameDic [ player ] ;
69- var rightItem = __instance . GetField < VisEquipment , GameObject > ( "m_rightItemInstance" ) ;
70- if ( rightItem != null ) rightItem . transform . localPosition = Settings . ReadVector3 ( name , "RightHandEuqipPos" , Vector3 . zero , false ) ;
71- }
72- }
73-
74- [ HarmonyPatch ( typeof ( VisEquipment ) , "SetLeftHandEquiped" ) ]
75- static class Patch_VisEquipment_SetLeftHandEquiped
76- {
77- [ HarmonyPostfix ]
78- static void Postfix ( VisEquipment __instance )
79- {
80- if ( ! __instance . m_isPlayer ) return ;
81-
82- var player = __instance . GetComponent < Player > ( ) ;
83- if ( player == null || ! VRMModels . PlayerToVrmDic . ContainsKey ( player ) ) return ;
84-
85- var name = VRMModels . PlayerToNameDic [ player ] ;
86- var leftItem = __instance . GetField < VisEquipment , GameObject > ( "m_leftItemInstance" ) ;
87- if ( leftItem != null ) leftItem . transform . localPosition = Settings . ReadVector3 ( name , "LeftHandEuqipPos" , Vector3 . zero , false ) ;
88- }
89- }
90-
9157 [ HarmonyPatch ( typeof ( VisEquipment ) , "UpdateLodgroup" ) ]
9258 static class Patch_VisEquipment_UpdateLodgroup
9359 {
@@ -118,6 +84,15 @@ static void Postfix(VisEquipment __instance)
11884
11985 var helmet = __instance . GetField < VisEquipment , GameObject > ( "m_helmetItemInstance" ) ;
12086 if ( helmet != null ) SetVisible ( helmet , false ) ;
87+
88+ // 武器位置合わせ
89+ var name = VRMModels . PlayerToNameDic [ player ] ;
90+
91+ var leftItem = __instance . GetField < VisEquipment , GameObject > ( "m_leftItemInstance" ) ;
92+ if ( leftItem != null ) leftItem . transform . localPosition = Settings . ReadVector3 ( name , "LeftHandEuqipPos" , Vector3 . zero ) ;
93+
94+ var rightItem = __instance . GetField < VisEquipment , GameObject > ( "m_rightItemInstance" ) ;
95+ if ( rightItem != null ) rightItem . transform . localPosition = Settings . ReadVector3 ( name , "RightHandEuqipPos" , Vector3 . zero ) ;
12196 }
12297
12398 private static void SetVisible ( GameObject obj , bool flag )
0 commit comments