public void VehicleSelect(bool status) { if (status == true) { _ready = true; readyImage.enabled = true; infoPanelHolder.SetActive(false); _camAnimator.Play("VehicleSelectCameraZoomIn"); abilityExampleScript[selectedCarID].DeactivateAllAbilites(); selectionManager.UpdateData(playerID, _ready, selectedCarID, _playerInput.GetPlayerNum()); } else { _ready = false; readyImage.enabled = false; infoPanelHolder.SetActive(true); _camAnimator.Play("VehicleSelectCameraZoomOut"); selectionManager.UpdateData(playerID, _ready, selectedCarID, _playerInput.GetPlayerNum()); } AudioManager.instance.PlayWithoutSpatial("Menu Selection"); }
private void Update() { if (Input.GetButtonDown(_playerInput.awakeButton) == true && _mouse.activeSelf == false && _ready == false) { _mouse.SetActive(true); Grid.GetComponent <Display>().changeStatus(true, _playerInput.GetPlayerNum());; Grid.GetComponent <Display>().addedCar(false); } else if (Input.GetButtonDown(_playerInput.backButton) == true && _mouse.activeSelf == false && _ready == true) { currentVehicle = 0; _ready = false; _isInfoOn = false; resetInfoScreens(); resetCars(); _mouse.SetActive(true); Grid.GetComponent <Display>().addedCar(false); Grid.GetComponent <Display>().confirmedCar(false); } if (Input.GetButtonDown(_playerInput.selectButton) == true && _ready == true && _isInfoOn == false) { Grid.GetComponent <Display>().confirmedCar(true); } if (Input.GetAxis(_playerInput.respawn) > 0 == true && _ready == true && _isInfoOn == false) { _isInfoOn = true; showInfoScreen(0); } if (_isInfoOn) { if (Mathf.Abs(Input.GetAxis(_playerInput.horizontal)) >= .2) { if (_canSwap) { int sign = (int)Mathf.Sign(Input.GetAxisRaw(_playerInput.horizontal)); _pageIndex += sign; _pageIndex = _pageIndex % 4; showInfoScreen(_pageIndex); _canSwap = false; } } else { _canSwap = true; } } }