This repository has been archived by the owner on Feb 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #257 from Henry00IS/Overlays
Added overlays support for 2021.2.
- Loading branch information
Showing
14 changed files
with
198 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ public override void ResetTool() | |
|
||
public override void Deactivated() | ||
{ | ||
base.Deactivated(); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#if UNITY_2021_2_OR_NEWER | ||
|
||
using UnityEditor; | ||
using UnityEditor.Overlays; | ||
using UnityEngine; | ||
|
||
namespace Sabresaurus.SabreCSG | ||
{ | ||
[Overlay(typeof(SceneView), k_Id, "SabreCSG Toolbar")] | ||
public class SabreToolbarOverlay : IMGUIOverlay | ||
{ | ||
private const string k_Id = "sabrecsg-toolbar-overlay"; | ||
public static SabreToolbarOverlay Instance; | ||
|
||
public override void OnCreated() | ||
{ | ||
base.OnCreated(); | ||
|
||
Instance = this; | ||
} | ||
|
||
public override void OnGUI() | ||
{ | ||
var model = CSGModel.GetActiveCSGModel(); | ||
|
||
if (model) | ||
{ | ||
Toolbar.CSGModel = model; | ||
|
||
if (Toolbar.primitiveMenuShowing) | ||
{ | ||
Toolbar.OnPrimitiveMenuGUI(0); | ||
} | ||
|
||
if (Toolbar.viewMenuShowing) | ||
{ | ||
Toolbar.OnViewMenuGUI(0); | ||
} | ||
|
||
if (!string.IsNullOrEmpty(Toolbar.WarningMessage)) | ||
{ | ||
Toolbar.OnWarningToolbar(0); | ||
} | ||
|
||
Toolbar.OnBottomToolbarGUI(0); | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#if UNITY_2021_2_OR_NEWER | ||
|
||
using UnityEditor; | ||
using UnityEditor.Overlays; | ||
using UnityEngine; | ||
|
||
namespace Sabresaurus.SabreCSG | ||
{ | ||
[Overlay(typeof(SceneView), k_Id, "SabreCSG Tools")] | ||
public class SabreToolsOverlay : IMGUIOverlay | ||
{ | ||
private const string k_Id = "sabrecsg-tools-overlay"; | ||
public static SabreToolsOverlay Instance; | ||
|
||
public static System.Action window1; | ||
public static System.Action window2; | ||
|
||
public override void OnCreated() | ||
{ | ||
base.OnCreated(); | ||
|
||
Instance = this; | ||
} | ||
|
||
public override void OnGUI() | ||
{ | ||
var model = CSGModel.GetActiveCSGModel(); | ||
if (model) | ||
{ | ||
Toolbar.CSGModel = model; | ||
Toolbar.OnTopToolbarGUI(0); | ||
|
||
window1?.Invoke(); | ||
window2?.Invoke(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.