Removed controller support

This commit is contained in:
Finnchen123
2025-06-07 13:18:25 +02:00
parent 1c0b2dcf68
commit 4f0615e2d9
10 changed files with 41 additions and 11320 deletions

View File

@@ -25,26 +25,16 @@ public class ControlsMenu : MonoBehaviour
void Update()
{
changeNameInput();
if(playerInput.currentControlScheme == "Controller"){
if(EventSystem.current.currentSelectedGameObject == null){
EventSystem.current.SetSelectedGameObject(FindFirstObjectByType<Button>().gameObject);
}
if(Cursor.lockState != CursorLockMode.Locked){
Cursor.lockState = CursorLockMode.Locked;
}
if(playerInput.currentActionMap.name != "Menu"){
playerInput.SwitchCurrentActionMap("Menu");
}
}
else{
if(Cursor.lockState != CursorLockMode.Confined){
Cursor.lockState = CursorLockMode.Confined;
}
if (Cursor.lockState != CursorLockMode.Confined)
{
Cursor.lockState = CursorLockMode.Confined;
}
}
public void FixedUpdate(){
if(direction != MoveDirection.None){
public void FixedUpdate()
{
if (direction != MoveDirection.None)
{
AxisEventData data = new AxisEventData(EventSystem.current);
data.moveDir = direction;
data.selectedObject = EventSystem.current.currentSelectedGameObject;
@@ -52,36 +42,33 @@ public class ControlsMenu : MonoBehaviour
}
}
public void OnMovement(InputValue value){
if(value.Get<Vector2>().x < 0){
public void OnMovement(InputValue value)
{
if (value.Get<Vector2>().x < 0)
{
direction = MoveDirection.Left;
}
else if(value.Get<Vector2>().x > 0){
else if (value.Get<Vector2>().x > 0)
{
direction = MoveDirection.Right;
}
else if(value.Get<Vector2>().y < 0){
else if (value.Get<Vector2>().y < 0)
{
direction = MoveDirection.Down;
}
else if(value.Get<Vector2>().y > 0){
else if (value.Get<Vector2>().y > 0)
{
direction = MoveDirection.Up;
}
}
public void OnBack(){
public void OnBack()
{
}
public void changeNameInput(){
if(uihandler.isCharacterCreation()){
if(playerInput.currentControlScheme == "Controller"){
if(EventSystem.current.currentSelectedGameObject == null || EventSystem.current.currentSelectedGameObject == GameObject.Find("inName")){
EventSystem.current.SetSelectedGameObject(GameObject.Find("btnRandomName"));
}
GameObject.Find("inName").GetComponent<InputField>().interactable = false;
}
else{
GameObject.Find("inName").GetComponent<InputField>().interactable = true;
}
}
public void changeNameInput()
{
GameObject.Find("inName").GetComponent<InputField>().interactable = true;
}
}