private void Start() { _activeMappings = InputEx.IsControllerConnected() ? controllerMappings : kbMappings; if (_activeMappings.CreateControlBindings().TryGetValue(action, out var binding)) { _binding = binding; } UpdateText(); }
private void Update() { if (InputEx.IsControllerConnected()) { mouse.SetActive(false); controller.SetActive(true); } else { mouse.SetActive(true); controller.SetActive(false); } }
private void Update() { bool updateNeeded = false; var mappings = InputEx.IsControllerConnected() ? controllerMappings : kbMappings; if (_activeMappings.CreateControlBindings().TryGetValue(action, out var binding)) { updateNeeded = _binding.HasValue && !Equals(_binding.Value, binding); _binding = binding; } if (mappings != _activeMappings) { _activeMappings = mappings; updateNeeded = true; } if (updateNeeded) { UpdateText(); } }