Skip to content

Commit 9e7b60d

Browse files
author
Karl Henkel
committed
fix compile error on 2018.3
1 parent f954a1e commit 9e7b60d

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

com.unity.probuilder/Editor/EditorCore/StaticEditorMeshHandles.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ namespace UnityEditor.ProBuilder
1111
partial class EditorMeshHandles
1212
{
1313
static bool s_Initialized;
14-
1514
static Material s_LineMaterial;
1615
static Material s_FaceMaterial;
1716

@@ -51,7 +50,7 @@ internal static void DrawGizmo(Vector3 position, Quaternion rotation, float size
5150
internal static void DrawGizmo(Vector3 position, Matrix4x4 matrix, float size = -1f)
5251
{
5352
var p = matrix.MultiplyPoint3x4(position);
54-
size = HandleUtility.GetHandleSize(p) * size < 0f ? .25f : size;
53+
size = HandleUtility.GetHandleSize(p) * size < 0f ? .2f : size;
5554

5655
using (var lineDrawer = new LineDrawingScope(Color.green, -1f, CompareFunction.Always))
5756
{

com.unity.probuilder/Editor/EditorCore/VertexTool.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ namespace UnityEditor.ProBuilder
88
abstract class VertexTool : VertexManipulationTool
99
{
1010
const bool k_CollectCoincidentVertices = true;
11+
#if APPLY_POSITION_TO_SPACE_GIZMO
12+
Matrix4x4 m_CurrentDelta = Matrix4x4.identity;
13+
#endif
1114

1215
class MeshAndPositions : MeshAndElementGroupPair
1316
{
@@ -36,7 +39,7 @@ protected override MeshAndElementGroupPair GetMeshAndElementGroupPair (ProBuilde
3639

3740
protected override void DoTool(Vector3 position, Quaternion rotation)
3841
{
39-
if (isEditing && currentEvent.type == EventType.Repaint)
42+
if ( isEditing && currentEvent.type == EventType.Repaint)
4043
{
4144
foreach (var key in meshAndElementGroupPairs)
4245
{
@@ -60,14 +63,23 @@ protected override void DoTool(Vector3 position, Quaternion rotation)
6063
}
6164
}
6265
#endif
66+
67+
#if APPLY_POSITION_TO_SPACE_GIZMO
68+
EditorMeshHandles.DrawGizmo(Vector3.zero, group.matrix.inverse * m_CurrentDelta);
69+
#else
6370
EditorMeshHandles.DrawGizmo(Vector3.zero, group.matrix.inverse);
71+
#endif
6472
}
6573
}
6674
}
6775
}
6876

6977
protected void Apply(Matrix4x4 delta)
7078
{
79+
#if APPLY_POSITION_TO_SPACE_GIZMO
80+
m_CurrentDelta.SetColumn(3, delta.GetColumn(3));
81+
#endif
82+
7183
foreach (var key in meshAndElementGroupPairs)
7284
{
7385
if (!(key is MeshAndPositions))

com.unity.probuilder/Settings/Editor/UserSettingsProvider.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
using System.Reflection;
1010
using UnityEngine;
1111
#if SETTINGS_PROVIDER_ENABLED
12+
#if UNITY_2018_3
13+
using UnityEngine.Experimental.UIElements;
14+
#else
1215
using UnityEngine.UIElements;
1316
#endif
17+
#endif
1418

1519
namespace UnityEditor.SettingsManagement
1620
{

0 commit comments

Comments
 (0)