/// <summary> /// Hides all UI elements /// </summary> public void HideAllSections() { foreach (var section in UiSections.Where(section => section.IsToggled)) { section.UiControllers.ForEach(controller => controller.Toggle(false)); section.IsToggled = false; } }
private void Update() { if (IsFrozen) { return; } // Action key reading if (Input.GetKeyUp(KeyCode.F)) { ActionKeyPress?.Invoke(this, Util.GetCharacter.transform.position); } // Binded key reading foreach (var section in UiSections.Where(section => Input.GetKeyDown(section.KeyCode))) { HideAllExcept(section); ToggledSection(section); } }