Removed controller support
This commit is contained in:
@@ -71,7 +71,6 @@ namespace Assets.Scripts.Menu
|
||||
saveText = saveText + uihandler.saveVideoSettings() + "\r\n";
|
||||
saveText = saveText + uihandler.saveLanguage() + "\r\n";
|
||||
saveText = saveText + audioHandler.saveAudioSettings() + "\r\n";
|
||||
saveText = saveText + "SensitivityController:"+GameObject.Find("slideSensitivityControllerHorizontal").GetComponent<Slider>().value + "/" + GameObject.Find("slideSensitivityControllerVertical").GetComponent<Slider>().value + "\r\n";
|
||||
saveText = saveText + "SensitivityMouse:"+GameObject.Find("slideSensitivityMouseHorizontal").GetComponent<Slider>().value + "/" + GameObject.Find("slideSensitivityMouseVertical").GetComponent<Slider>().value;
|
||||
FileHandler.saveOptions(saveText);
|
||||
uihandler.closeOptions();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user