-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExplorerKeybind.cs
More file actions
50 lines (45 loc) · 1.31 KB
/
ExplorerKeybind.cs
File metadata and controls
50 lines (45 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using UnityExplorer.Config;
using UnityExplorer.UI;
using UnityExplorer.UI.Widgets;
using UniverseLib.Input;
namespace UnityExplorer;
public static class ExplorerKeybind
{
public static void Update()
{
// check master toggle
if (InputManager.GetKeyDown(ConfigManager.Master_Toggle.Value))
{
UIManager.ShowMenu = !UIManager.ShowMenu;
}
TimeScaleKeyBindUpdate();
}
private static void TimeScaleKeyBindUpdate()
{
var widget = TimeScaleWidget.Instance;
if (widget == null)
{
return;
}
if (InputManager.GetKeyDown(ConfigManager.TIME_SCALE_TOGGLE.Value))
{
widget.OnPauseButtonClicked();
}
if (InputManager.GetKeyDown(ConfigManager.LOCK_TIME_SCALE_TO_ZERO.Value))
{
widget.LockTo(0.0f);
}
if (InputManager.GetKeyDown(ConfigManager.LOCK_TIME_SCALE_TO_NORMAL.Value))
{
widget.LockTo(1.0f);
}
if (InputManager.GetKeyDown(ConfigManager.LOCK_TIME_SCALE_TO_HALF.Value))
{
widget.LockTo(widget.DesiredTime * 0.5f);
}
if (InputManager.GetKeyDown(ConfigManager.LOCK_TIME_SCALE_TO_DOUBLE.Value))
{
widget.LockTo(widget.DesiredTime * 2.0f);
}
}
}