Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dev] Updating scripts to support 2017.3 #2122

Merged
merged 1 commit into from
May 17, 2018
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,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
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,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
Original file line number Diff line number Diff line change
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