protected virtual void Animation(Plane plane, Ray ray, BGTransition.SwayTransition transition)
        {
            float enter;

            if (plane.Raycast(ray, out enter))
            {
                swayTransition.Tick();

                Animate(transition, ray.GetPoint(enter), enter, plane);
            }
        }
        protected override void Animate(BGTransition.SwayTransition swayTransition, Vector3 point, float distanceToCamera, Plane plane)
        {
            rectTransition.Tick();

            var verts = GetVertsByPlaneAndDistance(new Vector3(rectTransition.Value, rectTransition.Value, rectTransition.Value), point, distanceToCamera, plane);


            var color = BGCurveSettingsForEditor.HandleColorForAddAndSnap2D;
            Handles.DrawSolidRectangleWithOutline(verts, color, new Color32(color.r, color.g, color.b, 255));
            Handles.DrawWireDisc(point, Vector3.Cross(verts[1] - verts[0], verts[2] - verts[0]), swayTransition.Value*distanceToCamera/24);
        }
Example #3
0
        public static void DrawHandlesGuiTexture(Vector2 screenPoint, BGTransition.SwayTransition pointIndicatorTransition, Texture2D pointSelectedTexture)
        {
            pointIndicatorTransition.Tick();

            var shift = pointIndicatorTransition.Value * .5f;

            BGEditorUtility.HandlesGui(() =>
            {
                GUI.DrawTexture(
                    new Rect(screenPoint - new Vector2(shift, shift), new Vector2(pointIndicatorTransition.Value, pointIndicatorTransition.Value)),
                    pointSelectedTexture, ScaleMode.StretchToFill);
            });
        }
Example #4
0
        protected override void Animation(Plane plane, Ray ray, BGTransition.SwayTransition transition)
        {
            var curve = overlay.Editor.Curve;

            if (!curve.Mode2DOn)
            {
                base.Animation(plane, ray, transition);
            }
            else
            {
                var settings = overlay.Editor.Settings;
                transition.Tick();
                Animate(transition, lastPosition, settings.NewPointDistance, plane);
            }
        }