Browse Source

Merge pull request #849 from msklywenn/develop

Correct View GizmoDrawer, limit type to View
master
Steve Halliwell 5 years ago committed by GitHub
parent
commit
527c80a1cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      Assets/Fungus/Scripts/Editor/ViewEditor.cs

11
Assets/Fungus/Scripts/Editor/ViewEditor.cs

@ -18,17 +18,14 @@ namespace Fungus.EditorUtils
// Draw Views when they're not selected // Draw Views when they're not selected
#if UNITY_5_0 #if UNITY_5_0
[DrawGizmo(GizmoType.NotSelected | GizmoType.SelectedOrChild)] [DrawGizmo(GizmoType.NotSelected | GizmoType.SelectedOrChild, typeof(View))]
#else #else
[DrawGizmo(GizmoType.NotInSelectionHierarchy | GizmoType.InSelectionHierarchy)] [DrawGizmo(GizmoType.NotInSelectionHierarchy | GizmoType.InSelectionHierarchy, typeof(View))]
#endif #endif
static void RenderCustomGizmo(Transform objectTransform, GizmoType gizmoType) static void RenderCustomGizmo(Transform objectTransform, GizmoType gizmoType)
{ {
View view = objectTransform.gameObject.GetComponent<View>(); View view = objectTransform.gameObject.GetComponent<View>();
if (view != null) DrawView(view, false);
{
DrawView(view, false);
}
} }
protected virtual Vector2 LookupAspectRatio(int index) protected virtual Vector2 LookupAspectRatio(int index)
@ -264,4 +261,4 @@ namespace Fungus.EditorUtils
return view.transform.InverseTransformPoint(view.transform.position + new Vector3(0, view.ViewSize, 0)).magnitude; return view.transform.InverseTransformPoint(view.transform.position + new Vector3(0, view.ViewSize, 0)).magnitude;
} }
} }
} }

Loading…
Cancel
Save