From f8841ef3b0f877c11295a7885fb740d9327eab16 Mon Sep 17 00:00:00 2001 From: Alireza_T Date: Wed, 24 Feb 2021 14:49:23 +0330 Subject: [PATCH] Use actual prefab rotation inside brush prefab --- Editor/Brushes/PrefabBrushes/PrefabBrush/PrefabBrush.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Editor/Brushes/PrefabBrushes/PrefabBrush/PrefabBrush.cs b/Editor/Brushes/PrefabBrushes/PrefabBrush/PrefabBrush.cs index 0d1f9a3..677a800 100644 --- a/Editor/Brushes/PrefabBrushes/PrefabBrush/PrefabBrush.cs +++ b/Editor/Brushes/PrefabBrushes/PrefabBrush/PrefabBrush.cs @@ -46,7 +46,8 @@ public override void Paint(GridLayout grid, GameObject brushTarget, Vector3Int p { var objectsInCell = GetObjectsInCell(grid, brushTarget.transform, position); var existPrefabObjectInCell = objectsInCell.Any(objectInCell => PrefabUtility.GetCorrespondingObjectFromSource(objectInCell) == m_Prefab); - + m_Rotation = Quaternion.Euler(m_Prefab.transform.eulerAngles); + if (!existPrefabObjectInCell) { base.InstantiatePrefabInCell(grid, brushTarget, position, m_Prefab, m_Rotation);