Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
InputFieldsTabSwitcher.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using UnityEngine;
3using UnityEngine.EventSystems;
4
5public class InputFieldsTabSwitcher : ManlySingleton<InputFieldsTabSwitcher>
6{
7 private EventSystem currentEventSystem;
8
9 private List<UiInputField> activeInputs = new List<UiInputField>();
10
11 private int currentActiveInputIndex = -1;
12
13 private void Start()
14 {
15 currentEventSystem = EventSystem.current;
16 }
17
18 private void Update()
19 {
20 if (Input.GetKeyDown(KeyCode.Tab))
21 {
23 }
24 }
25
26 private void TrySelectNextInput()
27 {
30 }
31
33 {
34 GameObject selectedObject = currentEventSystem.currentSelectedGameObject;
35 if (selectedObject != null)
36 {
37 currentActiveInputIndex = activeInputs.FindIndex((UiInputField x) => x.gameObject == selectedObject);
38 }
39 }
40
41 private void SelectNextInput()
42 {
44 {
45 activeInputs[currentActiveInputIndex].DeactivateInputField();
47 currentEventSystem.SetSelectedGameObject(activeInputs[currentActiveInputIndex].gameObject);
48 activeInputs[currentActiveInputIndex].ActivateInputField();
49 }
50 }
51
53 {
56 }
57
59 {
60 if (!activeInputs.Contains(input))
61 {
62 activeInputs.Add(input);
63 }
64 }
65
67 {
68 if (activeInputs.Contains(input))
69 {
70 activeInputs.Remove(input);
71 }
72 }
73}
void UnregisterInputField(UiInputField input)
void RegisterInputField(UiInputField input)
List< UiInputField > activeInputs