mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-19 05:48:07 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
16 lines
446 B
C#
16 lines
446 B
C#
namespace Editor;
|
|
|
|
public static class VRToggle
|
|
{
|
|
[Event( "editor.titlebar.buttons.build" )]
|
|
public static void OnBuildTitleBarButtons( TitleBarButtons titleBarButtons )
|
|
{
|
|
if ( EditorUtility.VR.HasHeadset )
|
|
{
|
|
var icon = Pixmap.FromFile( "common/virtual_reality.png" );
|
|
var button = titleBarButtons.AddToggleButton( icon, ( v ) => EditorUtility.VR.Enabled = v, EditorUtility.VR.Enabled );
|
|
button.ToolTip = "Toggle VR";
|
|
}
|
|
}
|
|
}
|