Skip to content

Commit

Permalink
Updating scripts to 2017.3
Browse files Browse the repository at this point in the history
  • Loading branch information
keveleigh committed May 3, 2018
1 parent bcd1121 commit febc453
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Expand Up @@ -111,7 +111,11 @@ private void OnDrawGizmosSelected()
UnityEditor.Handles.DrawLine(corners[1], corners[2]);
UnityEditor.Handles.DrawLine(corners[1], corners[3]);
UnityEditor.Handles.DrawLine(corners[2], corners[3]);
#if UNITY_2017_3_OR_NEWER
UnityEditor.Handles.ArrowHandleCap(0, center, Quaternion.FromToRotation(Vector3.forward, normal), 0.4f, EventType.Ignore);
#else
UnityEditor.Handles.ArrowHandleCap(0, center, Quaternion.FromToRotation(Vector3.forward, normal), 0.4f, EventType.ignore);
#endif

// If this plane is currently in the center of the camera's field of view, highlight it by drawing a
// solid rectangle, and display the important details about this plane.
Expand Down
Expand Up @@ -25,11 +25,21 @@ public override void OnInspectorGUI()
base.OnInspectorGUI();
serializedObject.Update();

#if UNITY_2017_3_OR_NEWER
drawPlanesMask.intValue = (int)((PlaneTypes)EditorGUILayout.EnumFlagsField("Draw Planes",
(PlaneTypes)drawPlanesMask.intValue));
#else
drawPlanesMask.intValue = (int)((PlaneTypes)EditorGUILayout.EnumMaskField("Draw Planes",
(PlaneTypes)drawPlanesMask.intValue));
#endif

#if UNITY_2017_3_OR_NEWER
destroyPlanesMask.intValue = (int)((PlaneTypes)EditorGUILayout.EnumFlagsField("Destroy Planes",
(PlaneTypes)destroyPlanesMask.intValue));
#else
destroyPlanesMask.intValue = (int)((PlaneTypes)EditorGUILayout.EnumMaskField("Destroy Planes",
(PlaneTypes)destroyPlanesMask.intValue));
#endif

serializedObject.ApplyModifiedProperties();
}
Expand Down
Expand Up @@ -116,7 +116,11 @@ public static T ObjectField<T>(Rect position, GUIContent label, T value, bool al
{
if (valueType.GetCustomAttributes(typeof(FlagsAttribute), true).Length > 0)
{
#if UNITY_2017_3_OR_NEWER
objValue = EditorGUI.EnumFlagsField(position, label, (Enum)objValue);
#else
objValue = EditorGUI.EnumMaskField(position, label, (Enum)objValue);
#endif
}
else
{
Expand Down

0 comments on commit febc453

Please sign in to comment.