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

@@ -17,11 +17,9 @@ public class Controls : MonoBehaviour
UIHandler uihandler;
Vector3 input;
Vector2 view;
PlayerInput playerInput;
public PlayerInput playerInput;
MoveDirection direction;
public Vector2 sensitivityController = new Vector2(0,0);
public Vector2 sensitivityMouse = new Vector2(0,0);
public Vector2 sensitivityMouse = new Vector2(0, 0);
float multiplier = 0.01f; //DEV Purpose only
@@ -55,14 +53,8 @@ public class Controls : MonoBehaviour
{
if (uihandler.canPlayerRotate())
{
if(playerInput.currentControlScheme == "Controller"){
playerCam.GetComponent<PlayerCamera>().LookAround(view, sensitivityController * multiplier);
player.GetComponent<PlayerGameObject>().rotate(view, sensitivityController * multiplier);
}
else{
playerCam.GetComponent<PlayerCamera>().LookAround(view, sensitivityMouse * multiplier);
player.GetComponent<PlayerGameObject>().rotate(view, sensitivityMouse * multiplier);
}
playerCam.GetComponent<PlayerCamera>().LookAround(view, sensitivityMouse * multiplier);
player.GetComponent<PlayerGameObject>().rotate(view, sensitivityMouse * multiplier);
}
if (uihandler.canPlayerMove())
{
@@ -74,7 +66,6 @@ public class Controls : MonoBehaviour
public void FixedUpdate()
{
Debug.Log(playerInput.currentControlScheme);
if (direction != MoveDirection.None)
{
AxisEventData data = new AxisEventData(EventSystem.current);
@@ -82,30 +73,18 @@ public class Controls : MonoBehaviour
data.selectedObject = EventSystem.current.currentSelectedGameObject;
ExecuteEvents.Execute(data.selectedObject, data, ExecuteEvents.moveHandler);
}
if (playerInput.currentControlScheme == "Controller")
if (uihandler.canPlayerRotate())
{
if (Cursor.lockState != CursorLockMode.Locked)
{
Cursor.lockState = CursorLockMode.Locked;
}
GameObject.Find("txtInteract").GetComponent<Text>().text = GameObject.Find("txtInteract").GetComponent<Text>().text.Replace("[E]", "[ButtonEast]");
GameObject.Find("txtInteraction_Tutorial").GetComponent<Text>().text = GameObject.Find("txtInteraction_Tutorial").GetComponent<Text>().text.Replace("[E]", "[ButtonEast]");
GameObject.Find("txtTutorialGoal").GetComponent<Text>().text = GameObject.Find("txtTutorialGoal").GetComponent<Text>().text.Replace("[ESC]", "[Start]");
Cursor.lockState = CursorLockMode.Locked;
}
else
{
if (uihandler.canPlayerRotate())
{
Cursor.lockState = CursorLockMode.Locked;
}
else
{
Cursor.lockState = CursorLockMode.Confined;
}
GameObject.Find("txtInteract").GetComponent<Text>().text = GameObject.Find("txtInteract").GetComponent<Text>().text.Replace("[ButtonEast]", "[E]");
GameObject.Find("txtInteraction_Tutorial").GetComponent<Text>().text = GameObject.Find("txtInteraction_Tutorial").GetComponent<Text>().text.Replace("[E]", "[ButtonEast]");
GameObject.Find("txtTutorialGoal").GetComponent<Text>().text = GameObject.Find("txtTutorialGoal").GetComponent<Text>().text.Replace("[Start]", "[ESC]");
Cursor.lockState = CursorLockMode.Confined;
}
GameObject.Find("txtInteract").GetComponent<Text>().text = GameObject.Find("txtInteract").GetComponent<Text>().text.Replace("[ButtonEast]", "[E]");
GameObject.Find("txtInteraction_Tutorial").GetComponent<Text>().text = GameObject.Find("txtInteraction_Tutorial").GetComponent<Text>().text.Replace("[E]", "[ButtonEast]");
GameObject.Find("txtTutorialGoal").GetComponent<Text>().text = GameObject.Find("txtTutorialGoal").GetComponent<Text>().text.Replace("[Start]", "[ESC]");
}
public void OnLooking(InputValue value)