diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/GameObjectCreation.cs b/Packages/com.unity.render-pipelines.universal/Editor/2D/GameObjectCreation.cs index 61491ba7da6..963933463c5 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/GameObjectCreation.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/GameObjectCreation.cs @@ -42,7 +42,7 @@ internal static void Place(GameObject go, GameObject parentTransform) transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.identity; transform.localScale = Vector3.one; - go.layer = parentTransform.gameObject.layer; + go.layer = parentTransform.layer; if (parentTransform.GetComponent()) ObjectFactory.AddComponent(go); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Light2DEditorUtility.cs b/Packages/com.unity.render-pipelines.universal/Editor/2D/Light2DEditorUtility.cs index 82fde669b49..7cc0b395e19 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/Light2DEditorUtility.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/Light2DEditorUtility.cs @@ -16,7 +16,7 @@ static internal void GUITextureCap(int controlID, Texture texture, Vector3 posit { case (EventType.Layout): { - Vector2 size2 = Vector2.one * size * 0.5f; + Vector2 size2 = 0.5f * size * Vector2.one; if (isAngleHandle) size2.x = 0.0f; @@ -32,7 +32,7 @@ static internal void GUITextureCap(int controlID, Texture texture, Vector3 posit float w = texture.width; float h = texture.height; float max = Mathf.Max(w, h); - Vector3 scale = new Vector2(w / max, h / max) * size * 0.5f; + Vector3 scale = 0.5f * size * new Vector2(w / max, h / max); if (Camera.current == null) scale.y *= -1f; diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/LightBatchingDebugger/LightBatchingDebugger.cs b/Packages/com.unity.render-pipelines.universal/Editor/2D/LightBatchingDebugger/LightBatchingDebugger.cs index c0111c57645..b0d7a830de2 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/LightBatchingDebugger/LightBatchingDebugger.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/LightBatchingDebugger/LightBatchingDebugger.cs @@ -133,7 +133,7 @@ private VisualElement GetInfoView() private void ViewBatch(int index) { - if (index >= batchList.Count()) + if (index >= batchList.Count) return; var infoView = GetInfoView(); @@ -150,7 +150,7 @@ private void ViewBatch(int index) var lightLabel1 = infoView.Query