Skip to content

Commit

Permalink
Modify GenericEditor.
Browse files Browse the repository at this point in the history
  • Loading branch information
mogoson committed Apr 5, 2018
1 parent 246b1b0 commit 6255622
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Assets/MGS-PathAnimation/Editor/BezierPathEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ protected override void OnSceneGUI()
if (Application.isPlaying)
return;

DrawAnchorHandle(Target.StartPoint, (position) => { Target.StartPoint = position; });
DrawAnchorHandle(Target.EndPoint, (position) => { Target.EndPoint = position; });
DrawAnchorHandle(Target.StartPoint, position => { Target.StartPoint = position; });
DrawAnchorHandle(Target.EndPoint, position => { Target.EndPoint = position; });

Handles.color = Color.green;
DrawAnchorHandle(Target.StartTangentPoint, (position) => { Target.StartTangentPoint = position; });
DrawAnchorHandle(Target.EndTangentPoint, (position) => { Target.EndTangentPoint = position; });
DrawAnchorHandle(Target.StartTangentPoint, position => { Target.StartTangentPoint = position; });
DrawAnchorHandle(Target.EndTangentPoint, position => { Target.EndTangentPoint = position; });

Handles.DrawLine(Target.StartPoint, Target.StartTangentPoint);
Handles.DrawLine(Target.EndPoint, Target.EndTangentPoint);
Expand Down
14 changes: 7 additions & 7 deletions Assets/MGS-PathAnimation/Editor/GenericEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class GenericEditor : Editor
protected readonly Vector3 MoveSnap = Vector3.one;

#if UNITY_5_5_OR_NEWER
protected readonly Handles.CapFunction CircleCap = Handles.CircleHandleCap;
protected readonly Handles.CapFunction SphereCap = Handles.SphereHandleCap;
protected readonly Handles.CapFunction CircleCap = Handles.CircleHandleCap;
protected readonly Handles.CapFunction SphereCap = Handles.SphereHandleCap;
#else
protected readonly Handles.DrawCapFunction CircleCap = Handles.CircleCap;
protected readonly Handles.DrawCapFunction SphereCap = Handles.SphereCap;
Expand Down Expand Up @@ -90,8 +90,8 @@ protected void DrawRotationHandle(Transform transform)
protected void DrawCircleCap(Vector3 position, Quaternion rotation, float size)
{
#if UNITY_5_5_OR_NEWER
if (Event.current.type == EventType.Repaint)
CircleCap(0, position, rotation, size, EventType.Repaint);
if (Event.current.type == EventType.Repaint)
CircleCap(0, position, rotation, size, EventType.Repaint);
#else
CircleCap(0, position, rotation, size);
#endif
Expand All @@ -100,8 +100,8 @@ protected void DrawCircleCap(Vector3 position, Quaternion rotation, float size)
protected void DrawSphereCap(Vector3 position, Quaternion rotation, float size)
{
#if UNITY_5_5_OR_NEWER
if (Event.current.type == EventType.Repaint)
SphereCap(0, position, rotation, size, EventType.Repaint);
if (Event.current.type == EventType.Repaint)
SphereCap(0, position, rotation, size, EventType.Repaint);
#else
SphereCap(0, position, rotation, size);
#endif
Expand All @@ -118,7 +118,7 @@ protected Quaternion GetPivotRotation(Transform transform)
protected void MarkSceneDirty()
{
#if UNITY_5_3_OR_NEWER
EditorSceneManager.MarkAllScenesDirty();
EditorSceneManager.MarkAllScenesDirty();
#else
EditorApplication.MarkSceneDirty();
#endif
Expand Down

0 comments on commit 6255622

Please sign in to comment.