Ver Fonte

Adjust bone mode drag point scale and colour

- maid drag points in bone mode are now all the same size as spine drag
points.
- Bone drag point scale is a little bit smaller than before.
- Bone drag point colour is more transparent now.
habeebweeb há 4 anos atrás
pai
commit
0ace515afa

+ 13 - 3
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/DragPoint/DragPoint.cs

@@ -37,8 +37,18 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private Vector3 startOffset;
         private Vector3 newOffset;
         public static Material dragPointMaterial = new Material(Shader.Find("CM3D2/Trans_AbsoluteFront"));
-        public static readonly Color defaultColour = new Color(0f, 0f, 0f, defaultAlpha);
-        public Vector3 BaseScale { get; private set; }
+        public static readonly Color defaultColour = new Color(0f, 0f, 0f, 0.4f);
+        public Vector3 OriginalScale { get; private set; }
+        private Vector3 baseScale;
+        public Vector3 BaseScale
+        {
+            get => baseScale;
+            protected set
+            {
+                baseScale = value;
+                transform.localScale = BaseScale * DragPointScale;
+            }
+        }
         private float dragPointScale = 1f;
         public float DragPointScale
         {
@@ -102,7 +112,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         private void Awake()
         {
-            BaseScale = transform.localScale;
+            BaseScale = OriginalScale = transform.localScale;
             collider = GetComponent<Collider>();
             renderer = GetComponent<Renderer>();
             ApplyDragType();

+ 2 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/DragPoint/DragPointMeido.cs

@@ -6,6 +6,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
     using static CustomGizmo;
     public abstract class DragPointMeido : DragPoint
     {
+        public static readonly Vector3 boneScale = Vector3.one * 0.04f;
         protected const int jointUpper = 0;
         protected const int jointMiddle = 1;
         protected const int jointLower = 2;
@@ -22,6 +23,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 if (value != isBone)
                 {
                     isBone = value;
+                    BaseScale = isBone ? boneScale : OriginalScale;
                     ApplyDragType();
                 }
             }