Пример #1
0
        public override void Draw(SVArgs args, ref object value)
        {
            Vector3 inPoint = (value as Vector3?).GetValueOrDefault();

            if (SceneViewHandles.DoFade(inPoint))
            {
                return;
            }

            value = Handles.DoPositionHandle(inPoint, Quaternion.identity);
        }
Пример #2
0
        public override void Draw(SVArgs args, ref object value)
        {
            Vector3Int[] inPoints = value as Vector3Int[];

            for (int i = 0; i < inPoints.Length; i++)
            {
                if (SceneViewHandles.DoFade(inPoints[i]))
                {
                    continue;
                }
                inPoints[i] = Vector3Int.RoundToInt(Handles.DoPositionHandle(inPoints[i], Quaternion.identity));
            }

            value = inPoints;
        }
Пример #3
0
        public override void Draw(SVArgs args, ref object value)
        {
            Vector3[] inPoints = value as Vector3[];

            EditorGUI.BeginChangeCheck();
            for (int i = 0; i < inPoints.Length; i++)
            {
                if (SceneViewHandles.DoFade(inPoints[i]))
                {
                    continue;
                }
                inPoints[i] = Handles.DoPositionHandle(inPoints[i], Quaternion.identity);
            }

            value = inPoints;
        }
Пример #4
0
        public override void Draw(SVArgs args, ref object value)
        {
            Transform t = args.MonoInstance.transform;

            Bounds inBounds  = (value as Bounds?).GetValueOrDefault();
            Bounds outBounds = inBounds;

            if (SceneViewHandles.DoFade(t.TransformPoint(inBounds.center)))
            {
                return;
            }

            outBounds.center = t.InverseTransformPoint(Handles.DoPositionHandle(t.TransformPoint(inBounds.center), Quaternion.identity));
            //outBounds.size = Handles.DoScaleHandle(inBounds.size, t.TransformPoint(outBounds.center), Quaternion.identity, 1f);

            Vector3 center  = t.TransformPoint(outBounds.center);
            Vector3 extents = outBounds.extents;

            // Draw our handles for dragging scale.
            Vector3 outSize = outBounds.size;

            outSize.x = Handles.ScaleSlider(outSize.x, center + (Vector3.right * outSize.x / 2f), Vector3.right, Quaternion.LookRotation(Vector3.right), HandleUtility.GetHandleSize(center + (Vector3.right * outSize.x / 2f)), 1f);
            outSize.x = Handles.ScaleSlider(outSize.x, center + (Vector3.left * outSize.x / 2f), Vector3.left, Quaternion.LookRotation(Vector3.left), HandleUtility.GetHandleSize(center + (Vector3.left * outSize.x / 2f)), 1f);

            outSize.y = Handles.ScaleSlider(outSize.y, center + (Vector3.up * outSize.y / 2f), Vector3.up, Quaternion.LookRotation(Vector3.up), HandleUtility.GetHandleSize(center + (Vector3.up * outSize.y / 2f)), 1f);
            outSize.y = Handles.ScaleSlider(outSize.y, center + (Vector3.down * outSize.y / 2f), Vector3.down, Quaternion.LookRotation(Vector3.down), HandleUtility.GetHandleSize(center + (Vector3.down * outSize.y / 2f)), 1f);

            outSize.z = Handles.ScaleSlider(outSize.z, center + (Vector3.forward * outSize.z / 2f), Vector3.forward, Quaternion.LookRotation(Vector3.forward), HandleUtility.GetHandleSize(center + (Vector3.forward * outSize.z / 2f)), 1f);
            outSize.z = Handles.ScaleSlider(outSize.z, center + (Vector3.back * outSize.z / 2f), Vector3.back, Quaternion.LookRotation(Vector3.back), HandleUtility.GetHandleSize(center + (Vector3.back * outSize.z / 2f)), 1f);

            outBounds.size = outSize;

            Handles.DrawWireCube(t.TransformPoint(outBounds.center), outBounds.size);

            value = outBounds;
        }