Skip to content

Commit da6f7e1

Browse files
committed
Adding a condition on shape generators to check rather the PB Editor is open
1 parent 44521f9 commit da6f7e1

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Editor/MenuActions/Editors/NewBezierShape.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public override bool hidden
2626

2727
public override bool enabled
2828
{
29-
get { return true; }
29+
get { return Experimental.experimentalFeaturesEnabled && ProBuilderEditor.instance != null; }
3030
}
3131

3232
protected override ActionResult PerformActionImplementation()

Editor/MenuActions/Editors/NewPolyShapeToggle.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public override bool hidden
3434

3535
public override bool enabled
3636
{
37-
get { return true; }
37+
get { return ProBuilderEditor.instance != null; }
3838
}
3939

4040
static bool CanCreateNewPolyShape()

Editor/MenuActions/Editors/NewShapeToggle.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ sealed class NewShapeToggle : MenuToolToggle
1818
public override TooltipContent tooltip { get { return s_Tooltip; } }
1919
public override string menuTitle { get { return "New Shape"; } }
2020
public override int toolbarPriority { get { return 0; } }
21-
protected override bool hasFileMenuEntry { get { return true; } }
2221

2322
static readonly TooltipContent s_Tooltip = new TooltipContent
2423
(
@@ -27,8 +26,9 @@ sealed class NewShapeToggle : MenuToolToggle
2726
keyCommandSuper, keyCommandShift, 'K'
2827
);
2928

30-
public override bool enabled {
31-
get { return true; }
29+
public override bool enabled
30+
{
31+
get { return ProBuilderEditor.instance != null; }
3232
}
3333

3434
protected override ActionResult PerformActionImplementation()

0 commit comments

Comments
 (0)