Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions Path Creator Project/Assets/PathCreator/Core/Editor/PathEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ void DrawBezierPathInspector () {
data.showPathBounds = GUILayout.Toggle (data.showPathBounds, new GUIContent ("Show Path Bounds"));
data.showPerSegmentBounds = GUILayout.Toggle (data.showPerSegmentBounds, new GUIContent ("Show Segment Bounds"));
data.displayAnchorPoints = GUILayout.Toggle (data.displayAnchorPoints, new GUIContent ("Show Anchor Points"));
if (data.displayAnchorPoints)
{
data.displayAnchorNumbers = GUILayout.Toggle(data.displayAnchorNumbers,
new GUIContent("Show Anchor Numbers"));
}
if (!(bezierPath.ControlPointMode == BezierPath.ControlMode.Automatic && globalDisplaySettings.hideAutoControls)) {
data.displayControlPoints = GUILayout.Toggle (data.displayControlPoints, new GUIContent ("Show Control Points"));
}
Expand Down Expand Up @@ -525,7 +530,6 @@ void DrawHandle (int i) {
var cap = capFunctions[(isAnchorPoint) ? globalDisplaySettings.anchorShape : globalDisplaySettings.controlShape];
PathHandle.HandleInputType handleInputType;
handlePosition = PathHandle.DrawHandle (handlePosition, bezierPath.Space, isInteractive, handleSize, cap, handleColours, out handleInputType, i);

if (doTransformHandle) {
// Show normals rotate tool
if (data.showNormals && Tools.current == Tool.Rotate && isAnchorPoint && bezierPath.Space == PathSpace.xyz) {
Expand Down Expand Up @@ -559,6 +563,16 @@ void DrawHandle (int i) {

}

if (isAnchorPoint && data.displayAnchorNumbers)
{
var handleNumberText = string.Format("{0}", i / 3 + 1);
GUIStyle handleNumberTextStyle = new GUIStyle();
handleNumberTextStyle.normal.textColor = globalDisplaySettings.anchorNumberColor;
handleNumberTextStyle.fontSize = globalDisplaySettings.anchorNumberSize;
Handles.Label(handlePosition, handleNumberText, handleNumberTextStyle);
}


switch (handleInputType) {
case PathHandle.HandleInputType.LMBDrag:
draggingHandleIndex = i;
Expand Down Expand Up @@ -596,9 +610,7 @@ void DrawHandle (int i) {
if (bezierPath[i] != localHandlePosition) {
Undo.RecordObject (creator, "Move point");
bezierPath.MovePoint (i, localHandlePosition);

}

}

#endregion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;

namespace PathCreation
{
Expand Down Expand Up @@ -29,6 +27,10 @@ public enum HandleType { Sphere, Circle, Square };
public Color anchorHighlighted = new Color(1, 0.57f, 0.4f);
public Color anchorSelected = Color.white;

[Header("Anchor Numbers")]
public int anchorNumberSize = 14;
public Color anchorNumberColor = Color.white;

[Header("Control Colours")]
public Color control = new Color(0.35f, 0.6f, 1, 0.85f);
public Color controlHighlighted = new Color(0.8f, 0.67f, 0.97f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class PathCreatorData {
public bool showPathBounds;
public bool showPerSegmentBounds;
public bool displayAnchorPoints = true;
public bool displayAnchorNumbers = true;
public bool displayControlPoints = true;
public float bezierHandleScale = 1;
public bool globalDisplaySettingsFoldout;
Expand Down