// Update is called once per frame void Update() { bool shortcutPressed = true; bool shortcutDown = false; // Checks to make sure that all keys are pressed and that one of the required shortcut keys was pressed on this frame // before bringing up the shortcut foreach (KeyCode key in HelpGuideShortcutKeys) { shortcutPressed &= KeyInputSystem.GetKey(KeyBinding.FromKey(key)); shortcutDown |= KeyInputSystem.GetKeyDown(KeyBinding.FromKey(key)); } if (shortcutPressed && shortcutDown) { HelpGuideVisual.transform.parent = CameraCache.Main.transform; HelpGuideVisual.transform.rotation = CameraCache.Main.transform.rotation; HelpGuideVisual.transform.localPosition = helpDisplayOffset; HelpGuideVisual.transform.parent = null; HelpGuideVisual.SetActive(!HelpGuideVisual.activeSelf); HelpGuideShortcutTip.SetActive(false); } }
// Update is called once per frame void Update() { bool shortcutPressed = true; bool shortcutDown = false; // Checks to make sure that all keys are pressed and that one of the required shortcut keys was pressed on this frame // before bringing up the shortcut foreach (KeyCode key in HelpGuideShortcutKeys) { shortcutPressed &= KeyInputSystem.GetKey(KeyBinding.FromKey(key)); shortcutDown |= KeyInputSystem.GetKeyDown(KeyBinding.FromKey(key)); } if (shortcutPressed && shortcutDown) { HelpGuideVisual.SetActive(!HelpGuideVisual.activeSelf); HelpGuideShortcutTip.SetActive(false); } }