Browse Source

Fix bug where with dragpoint free look toggle

Free look could not be toggled on double clicking the maid's head when
IK mode is disabled while having Bone mode enabled at the same time.
habeebweeb 4 năm trước cách đây
mục cha
commit
befff68e41

+ 7 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/DragPointManager.cs

@@ -171,6 +171,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 {
                     dragPoint.Value.gameObject.SetActive(false);
                 }
+                DragPoint[Bone.Head].SetDragProp(false, true, false);
+                DragPoint[Bone.Body].SetDragProp(false, true, false);
+                DragPoint[Bone.Cube].SetDragProp(false, true, true);
             }
         }
 
@@ -250,6 +253,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                     DragPoint[Bone.Body].gameObject.SetActive(true);
                     DragPoint[Bone.Cube].gameObject.SetActive(cubeActive);
                 }
+                else if (ikMode == IKMode.UpperRot || ikMode == IKMode.RotLocal)
+                {
+                    DragPoint[Bone.Head].gameObject.SetActive(true);
+                }
                 else
                 {
                     DragPoint[Bone.Body].gameObject.SetActive(false);

+ 4 - 2
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/IK/DragHead.cs

@@ -35,7 +35,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 // eyes
                 dragType = Utility.GetModKey(Utility.ModKey.Shift) ? DragType.MoveY : DragType.MoveXZ;
             }
-            else if (Input.GetKey(KeyCode.LeftAlt))
+            else if (Utility.GetModKey(Utility.ModKey.Alt))
             {
                 // head
                 dragType = shift ? DragType.RotLocalY : DragType.RotLocalXZ;
@@ -70,6 +70,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 return;
             }
 
+            if (IsBone) return;
+
             base.InitializeDrag();
 
             rotate = head.localEulerAngles;
@@ -81,7 +83,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         protected override void Drag()
         {
-            if (dragType == DragType.None || dragType == DragType.Select) return;
+            if ((dragType == DragType.None || dragType == DragType.Select) || IsBone) return;
 
             if (!(dragType == DragType.MoveXZ || dragType == DragType.MoveY))
             {